How to back up your Hubs instance
These instructions are written for users, newbies, or non-developers.
Why would I need to create backups of my Hubs instance?
Backups allow you to have copies so that you can restore your Hubs instance in case anything goes wrong or shut down your Hubs instance and later set it up again like it was. This will save all of your instance, things like your avatars, and your projects in Spoke, your assets in Spoke, and will save pinned objects in room in the location where you pinned them.
A backup of your Hubs instance stores all of those files into one directory on your local computer that you can restore from at any time.
How to do a backup
Open VS Code. Make sure you are in the community-edition folder. This is similar to the Beginner's Guide, Step 12h.
Enter
npm run backup
a. In case you see Error: Cannot find module 'yaml', you need to do a clean install like you did in the Beginner’s Guide, Step 12i.
b. In the community-edition folder, you should see a folder called data_backups. That is where the backups are stored. There is one folder per backup. The backup is named data_backup with a time stamp which is a long number representing the date as time in seconds; the bigger the number, the later in time the backup.
In case you are confused, in the File Explorer, select the file using the secondary mouse button (right click) and choose Reveal. The modified date field should reflect the date when the backup was last modified.
In our testing, this took five to 15 minutes, but if you have a lot of data or a slow Internet connection, it could take hours. When it is done, the terminal will be back in the state where it is ready to accept a command.
How to restore a backup
Open VS Code. Make sure you are in the community-edition folder. This is similar to the Beginner's Guide, Step 12h.
Enter
npm run restore-backup
However, you can restore a specific backup by specifying which backup for the process to use. In that case, you’ll add the actual file name like this:
data_backup_<XXX>
For example:
npm run restore-backup data_backup_1753910374452
With respect to size and internet connection speed, this will take a few minutes. In our testing, it took us between five and 30 minutes. With an instance with a lot of data or over a slow Internet connection, it could take hours.
Once the script is finished, the terminal will display ‘instance restarted’.
Your instance is back up and running. All of your data should be there. Close VS Code.
Note: It will take a short while for everything to be restored. It takes a few minutes for Hubs to restart itself.
FAQs for Backups
Error codes
If VS Code returns an error script like this below, the solution is to re-run the last command (either the backup or the restore command) until it works.