Moving an Existing OpenBazaar Store to OB1 Deploy
We recently released a new service called Deploy, which allows users to easily set up an OpenBazaar server to a Digital Ocean VPS so that their stores can be accessible 24/7.
By default, this service creates a new OpenBazaar store. But there are many users who already have a store and want to move it to a VPS. This article will explain how to move an existing store from your local computer (or other VPS) onto the Digital Ocean VPS created by Deploy.
First, you need to go through the process of using Deploy, described in this article. Make sure you save the credentials at the end so that you know the IP address of the VPS, as well as the SSH password. (The right panel which says “Connect to SSH” has those details, as shown in this picture.)
Now that you have a droplet created on your Digital Ocean account with OpenBazaar installed, you can move your existing store onto the new droplet. The following instructions take place on the machine with the existing store you want to migrate, not on the new droplet.
Download git bash
git bash from: https://git-for-windows.github.io/
Ensure that the Windows Explorer Integration is selected.
Accept the default installation options after this.
Prepare the OpenBazaar Folder
Open Windows Explorer and navigate to your database folder. The default location of the database folder:
You’ll need to enable see ‘Hidden Files and Folders’ in Windows Explorer to find the
AppData folder. The folder should look like this:
Cache folder and delete all the files in that folder.
Send the OpenBazaar folder to your Deploy node and start
Make sure you’re still in your OpenBazaar database folder (not in
Right click an empty space in Windows Explorer and select
Git Bash Here.
This will open a
git bash terminal window that we'll be using to send your database folder to your Deploy server.
Type the following command into the terminal:
scp -r . openbazaar@[ip_address]:/home/openbazaar/new_data
[ip_address] with the IP address of your Deploy server.
You’ll be asked whether you want to continue, type
Paste in your SSH Deploy password.
- Pro tip:
ctrl-vdoesn't work in
git bashso use
shift-Insto paste in commands into the terminal
Enter the next command:
ssh openbazaar@[ip_address] -C "sudo service openbazaard stop; rm -r data; mv new_data data && sudo service openbazaard start"
This command firstly stop OpenBazaar running on Deploy, replaces the database on Deploy with the database folder you sent in the previous step, and restarts OpenBazaar
Now your Deploy server has been successfully migrated!
OSX and Linux Users
First, open your terminal and navigate to the folder where your OpenBazaar data is being held. You should find your data folder at the following locations:
OSX: ~/Library/Application Support/OpenBazaar
Now that you are in the data folder, enter the following commands into the terminal. In places with bold text, you will need to replace the bold text with the IP address of your new Deploy droplet.
rm -r cache*
These commands remove the unnecessary debug log and cache from the current installation.
scp -r . openbazaar@<ip>:/home/openbazaar/new_data
This command copies your files from your local computer onto the Deploy VPS. Note that you must enter the IP address of the Deploy VPS in place of the <ip> for this to work. If we were using the picture above as an example, this is what the command would look like:
Example: scp -r . email@example.com:/home/openbazaar/new_data
You’ll be asked if you want to continue, and type “yes.” Then you’ll be asked for a password, which you received when you went through the Deploy process. You can paste into terminal by using Ctrl+Shift+V.
Your data is now in place. Now you need to connect to your Deploy VPS and tell it to stop running, delete the temporary store that was created initially, move your new data to the right place, and start up the server again. This long command looks as follows:
ssh openbazaar@<ip> -C ‘sudo service openbazaard stop; tar -zcvf backup.tar.gz data && rm -r data; mv new_data data && sudo service openbazaard start’
Once again, you need to enter the Deploy IP address in place of the <ip> for this to work. Continuing the previous example, it would look like this:
Example : ssh firstname.lastname@example.org -C ‘sudo service openbazaard stop; tar -zcvf backup.tar.gz data && rm -r data; mv new_data data && sudo service openbazaard start’
Your existing store should now be fully migrated to the Deploy VPS. Try using a “Client Only” installer to connect to your new store. If you need help with this process, watch the following video.
If this process didn’t work for you, visit our Slack group for some help.
Thanks to Washington for writing the Windows instructions.