GMDprivateServer icon indicating copy to clipboard operation
GMDprivateServer copied to clipboard

Is there a way to recover deleted levels?

Open TAL9988 opened this issue 1 year ago • 5 comments

So, last night, I made a small error in the servers that resulted in the deletion of more than 500 levels. (I won't go into detail about how I did it because it is so embarrassing.)

I started by looking for a backup sql file, which I did. however, it informs me that the table "acccomments" already exists anytime I import that. (#1050 - Table 'acccomments' already exists)

Someone advised me to look in my ftp's levels folder (.../data/levels), where the deleted levels may still be found. But can you use these files to restore the levels?

I would be grateful if someone could assist me with level restoration.

TAL9988 avatar Sep 29 '22 14:09 TAL9988

@TAL9988 Both ways gonna work for you.

If you want to restore levels by the SQL backup, you must edit it before so you don't get errors: instead of CREATE TABLE write CREATE TABLE IF NOT EXISTS.

But if you want to restore them by ftp's data - theoretically - you can, because basic level info is saved & encrypted here, but it would be hard for you to decode & re-upload to database 500+ levels. Only if you make a bot or smth that would do it all instead of you...

So it's better to edit SQL backup.

crypton1871 avatar Sep 29 '22 17:09 crypton1871

Ok so I tried your SQL method. I edited the sql file and edited the "CREATE TABLE" to "CREATE TABLE IF NOT EXISTS".

I tried and it got me with this error -> #1062 - Duplicate entry '2' for key 'PRIMARY' Any idea what did I do wrong here?

TAL9988 avatar Sep 29 '22 19:09 TAL9988

So, you want to recover only levels? You deleted levels only in SQL?

MegaSa1nt avatar Sep 30 '22 02:09 MegaSa1nt

Ok so I tried your SQL method. I edited the sql file and edited the "CREATE TABLE" to "CREATE TABLE IF NOT EXISTS".

I tried and it got me with this error -> #1062 - Duplicate entry '2' for key 'PRIMARY' Any idea what did I do wrong here?

it means that it's trying to create something with the ID 2 (the error didn't specify the table so that's up to you to figure out) but you already have something else with the ID 2 in the database

Cvolton avatar Sep 30 '22 09:09 Cvolton

bro even cvolton commented 💀

crypton1871 avatar Sep 30 '22 09:09 crypton1871