willhlaw / node-firestore-backup-restore

Google Firebase Firestore backup and restore tool
91 stars 24 forks source link

.DS_Store prevents successfull restore #34

Open amjadyahya opened 6 years ago

amjadyahya commented 6 years ago

When I try to restore using this command: firestore-backup-restore --backupPath /Users/amjad/Desktop/untitledfolder/iOrder --restoreAccountCredentials /Users/amjad/Desktop/iorder--credentials.json

I get the following error:

The behavior for Date objects stored in Firestore is going to change
AND YOUR APP MAY BREAK.
To hide this warning and ensure your app does not break, you need to add the
following code to your app before calling any other Cloud Firestore methods:

  const settings = {/* your settings... */ timestampsInSnapshots: true};
  const firestore = new Firestore(settings);

With this change, timestamps stored in Cloud Firestore will be read back as
Firebase Timestamp objects instead of as system Date objects. So you will also
need to update code expecting a Date to instead expect a Timestamp. For example:

  // Old:
  const date = snapshot.get('created_at');
  // New:
  const timestamp = snapshot.get('created_at');
  const date = timestamp.toDate();

Please audit all existing usages of Date when you enable the new behavior. In a
future release, the behavior will change to the new behavior, so if you do not
follow these steps, YOUR APP MAY BREAK.
Restoring to collection /Users/amjad/Desktop/untitledfolder document /Users/amjad/Desktop/untitledfolder/iOrder/.DS_Store
undefined:1

SyntaxError: Unexpected token 

I have activated show hidden files on my MAC, I couldn't locate the .DS_Store in the restore folder. I'm stuck and cannot restore my backup files

mambisi commented 6 years ago

I have the same error

kitfit-dave commented 5 years ago

There is likely one in there somewhere... Try this to remove them (then try the restore again): find /Users/amjad/Desktop/untitledfolder/iOrder -name '.DS_Store' -type f -delete