Corrupted Data--Urgent

I have done what I should not have. I left Scrivener running on my home laptop accidentally. When I opened it at work, I ignored the message that it was already open somewhere else, thinking that the home file had to have been automatically saved, so all should be well. I worked fine on it all day here.

When I went home, I closed the version that had been open, then reopened it, and that’s where the problems started. When I would create a new note, it would pull the text from another entry. I closed it out properly and came back to the office today. The items I entered at home last night are not here and the office version is now popping existing material into new notes.

Can I fix this? I sync using SugarSync, by the way, and have never had a problem before.

First of all, I’m sympathetic to your plight. The good news is - I think all of your work has been saved and will be intact. The bad news is - it may take a bit of tedious effort to re-assemble it to the desired state. I strongly suggest you contact SugarSync tech support for assistance. I use SugarSync myself and I believe when a situation is encountered like you have described, everything will be saved and the files in question (those project files opened on two PCs at once) will be noted as conflicting files. You may have to go through each of them manually to determine which one is current. In fact, some of your current work may be distributed across different conflicting files. That is why I strongly suggest you contact SugarSync support for assistance. I think they will be able to walk you through the best procedure to get everything restored to a workable state.

Best of luck.

Dick Keaton

I’m not as familiar with SugarSync, but I believe it’s more or less the same as Dropbox in this particular regard, and as Dick suggests, your work should all be intact, but you’ll need to pick through your files in order to clean it up. Normally I’d say the simplest fix would be to just restore a backup, but it sounds like you did make new changes on your home computer after working in the office, in which case that’s not as viable a solution since you’d end up discarding all the changes. You’ll have to just take a look at what you’ve got and figure out what route you want to go with this, since maybe you’ll value the time saved just restoring the back up over the work lost if it was only minimal changes.

The problem is that you’ve ended up with conflicted copies of documents due to syncing changes from two machines while the project was open. Scrivener saves while you’re working and always saves when the project is closed in order to keep all its internal files in sync. What that means here though is that you made changes to the project files on the SugarSync server on computer B that the project on computer A was unaware of, and when you closed the project on A, it pushed its version of the files to the server, and you ended up with two copies of some files, including the the backbone .scrivx file that structures the binder. Now the copy of the project on computer A isn’t aware of the documents that were created on B, and vice versa, because they’re all out of sync.

Scrivener’s documents internally are identified by an incrementing ID number. So as an example here, if you created a new document on computer B, Scrivener would look at the scrivx file, determine the last used number, and create the new document link giving it the next available number. Due to the sync conflict, the scrivx file on computer A doesn’t know that the new document was ever created, so when you next created a document on that copy of the project, it did the same thing and ended up creating a document with the same number. A document with that number already existed in the project folder, however, since you created it on B–it’s just that the .scrivx file hadn’t been updated to recognise it. So once the ID number got added to the binder structure, the existing document with that ID was immediately linked to it, and your text appeared spontaneously in the “new” document.

You can use this to help restore all the newly created documents into your project–just keep creating binder items until all your missing document text has reappeared. However, this won’t fix any conflict issues with existing documents that you may have edited, so you’ll still want to take a look into the project folder and clean up the conflicted files. Pick one of your machines to work on and take care of everything there, then once it’s patched up, make sure you let it sync completely to the second machine before you open the project. (As soon as you open, Scrivener will start saving, so it’s crucial you always ensure the sync is complete before opening the project.) To start with, close the project in Scrivener (make sure it’s closed on both computers!) and make a backup of the project’s .scriv folder by right-clicking it and choosing “Send to \ Compressed (zipped) folder”.

Now navigate into the folder and start looking for any “conflicted” files or such–I’m not sure how SugarSync will name these, but my guess is you’d have a file name with your computer name or date tacked onto the end, indicating where and when it (the conflicted version) was created. Go through and remove all the conflicted copies of the files to another location–don’t trash them yet, just get them out of the project folder, leaving the unconflicted copy. Then open the project in Scrivener.

Assuming you have removed files from the project folder’s Files\Docs folder, you’ll want to go through these one at a time to figure out whether they contain any edits that you want to keep and need to copy over to the version of the file that’s currently in the project. If you like, you can import all these into the project by dragging them into the binder, and you can then use the split editor to compare the conflicted version with the original, and easily copy text from one to the other. Once you’re happy with it, you can delete the unwanted copy from the project.

In the case of the project file (.scrivx if you see extensions; this is the one you click to open the project), unless you’re keen on doing a lot of XML editing by hand, you’re probably going to need to just pick a version to use as the base and trash the other one; it’s typically going to be easier to just fix any meta-data changes or the binder order directly in Scrivener. Other files from the Settings folder and whatnot likewise are usually best just discarded if there is a duplicate. It’s really just the files in the Files\Docs folder that are important to sort through, as these are your text documents.

Once you have the project fixed up, close it and let it sync so you’ll have the restored version on the server and again, just make sure you give sufficient time to let all those changes sync to your other machine before you open the project there. Then you should be all back in sync and ready to work. If you haven’t, I highly recommend looking through the “Scrivener Everywhere” section of the user manual or checking out the knowledge base article on working with sync servers (Dropbox is the example, but it holds for SugarSync as well).

I hope that gets you all sorted out without too much fuss!

Thanks so much to you both. I believe I understand how it works and have cleaned it up. It’s a relief to know I haven’t permanently destroyed it.