PDA

View Full Version : Confused about Backup and Restore


EightBitz
January 25th, 2017, 10:17 AM
I have a Realm, let's call it "Realm X", where I wanted to try something that we'll arbitrarily call "clever". *ahem* *cough*

Step 1: Run a backup.
Step 2: Make a copy of Realm X.

I did both of those things in that order. Then I did a full export of Realm X.

Now here's the "clever" bit. (Sometimes there's a fine line between "clever" and "stupid", right?) I opened the the export as an XML file and made a manual edit. Specifically, I removed the cover art. I did this by deleting everything between <cover_art> and </cover_art>. I left those two tags untouched, but deleted everything between them.

I saved that, went back to Realm Works, and deleted Realm X. I recreated Realm X and tried to import the edited .rwexport file. It failed.

It was worth a shot, but since it failed, I figured I'd just restore my database, and all will be well.

So I run the restore, and I get no errors. But when I check my realms, Realm X is still empty. My original data (which was there when I made the backup) is gone.

I thought that maybe since there's a realm there with the same name as the one I want restored, it's getting confused. So I delete the ream, and run another restore. Realm X is not there.

However, the copy I made earlier (after the backup) IS there.

Generally speaking, my understanding of backup and restore is that when you backup a database, it backs up everything that's there. And when you do a restore, it restores your database to the exact same state as when you made the backup, meaning not only that all the data you had is restored, but also that any new data that was created after the backup is now lost.

Again, the restore should put the database in the exact same state as it was in at the moment of the backup.

Obviously, in this case, either I did something wrong, or the backup/restore process for Realm Works works differently than a traditional database backup.

Can anyone offer any insights?

davidp
January 25th, 2017, 10:35 AM
I have a Realm, let's call it "Realm X", where I wanted to try something that we'll arbitrarily call "clever". *ahem* *cough*

Step 1: Run a backup.
Step 2: Make a copy of Realm X.

I did both of those things in that order. Then I did a full export of Realm X.

Now here's the "clever" bit. (Sometimes there's a fine line between "clever" and "stupid", right?) I opened the the export as an XML file and made a manual edit. Specifically, I removed the cover art. I did this by deleting everything between <cover_art> and </cover_art>. I left those two tags untouched, but deleted everything between them.

I saved that, went back to Realm Works, and deleted Realm X. I recreated Realm X and tried to import the edited .rwexport file. It failed.

It was worth a shot, but since it failed, I figured I'd just restore my database, and all will be well.

So I run the restore, and I get no errors. But when I check my realms, Realm X is still empty. My original data (which was there when I made the backup) is gone.

I thought that maybe since there's a realm there with the same name as the one I want restored, it's getting confused. So I delete the ream, and run another restore. Realm X is not there.

However, the copy I made earlier (after the backup) IS there.

Generally speaking, my understanding of backup and restore is that when you backup a database, it backs up everything that's there. And when you do a restore, it restores your database to the exact same state as when you made the backup, meaning not only that all the data you had is restored, but also that any new data that was created after the backup is now lost.

Again, the restore should put the database in the exact same state as it was in at the moment of the backup.

Obviously, in this case, either I did something wrong, or the backup/restore process for Realm Works works differently than a traditional database backup.

Can anyone offer any insights?

When you delete a realm, it is permanent as the server is involved in the deletion and has it as deleted. Doing the restore still leaves the realm deleted from the server's perspective so it gets marked as deleted within the restored database.

This is why we have the big huge warning about deleting a realm is permanent.

EightBitz
January 25th, 2017, 10:43 AM
When you delete a realm, it is permanent as the server is involved in the deletion and has it as deleted. Doing the restore still leaves the realm deleted from the server's perspective so it gets marked as deleted within the restored database.

This is why we have the big huge warning about deleting a realm is permanent.

Well yeah, but there's permanent, and then there's permanent. :-) A lot of programs have warnings that deleting data is permanent, but if you do a restore, the data comes back.

Anyway, not complaining. Now that I know, I know.

And that, I'm assuming, is the same reason that the restore process doesn't delete realms that were there prior to the backup? So backup and restore just applies to content within realms?

And in that context, does it just restore content that was deleted, or does it also remove content that wasn't there in the backup?

MaxSupernova
January 25th, 2017, 10:47 AM
So you can't restore a deleted realm from a backup file?

That seems like an interesting design decision, warning or not.

Kind of a new spin on the concept of "backup".

davidp
January 25th, 2017, 10:57 AM
It gets extremely gnarly if deleted realms came back with a restore when dealing also with offline usage and the server. There are cases where it can cause very bad things to happen if we allowed it.

Strategon
January 25th, 2017, 10:57 AM
So you can't restore a deleted realm from a backup file?

That seems like an interesting design decision, warning or not.

Kind of a new spin on the concept of "backup".

That's similar to Obsidian Portal: You can make a backup of your campaign, you just can't use it to restore a campaign.


What happens if you don't delete said realm? If you restore the back up it overwrites the new one? Instead of delete, copy realm and rename it, then try restoring?

Acenoid
January 25th, 2017, 12:07 PM
Maybe there should be the option upon restore to generate a new "server" realm?

kbs666
January 25th, 2017, 12:28 PM
Can't help you now but when you are experimenting like this, don't sync to the server, no matter what you've done unless you are 100% sure you want the change to be permanent.

Bidmaron
January 25th, 2017, 12:52 PM
If that is the case, when you delete a realm and you detect a backup has been made, I recommend that you warn the user that his backup will be worthless. This is not how most folks will think about how a backup works.

davidp
January 25th, 2017, 02:37 PM
If that is the case, when you delete a realm and you detect a backup has been made, I recommend that you warn the user that his backup will be worthless. This is not how most folks will think about how a backup works.

We have the message right now when you delete a realm that includes this text:

It will no longer be syncable and cannot be recovered via backup.

EightBitz
January 25th, 2017, 02:40 PM
OK, mea culpa. When you delete a realm, it does actually explicitly say that the realm cannot be recovered from a backup.