use vesta v-restore-user
Today I came across a solution that I was looking for about 3 days. I, being new to Ubuntu Linux was unknown to how to do some of the basic stuff that you do in Ubuntu. While working with vestacp for a client, i needed to restore to a new server.
Here is the original instructions from https://vestacp.com/docs/#how-to-migrate-user-to-another-server:
How to migrate user to the new server
1. Make user backup on the old server. In this example we will use admin as the reference.
2. Copy tarball to the new server and place it in the /home/backup directory
scp /home/backup/admin.2014-01-14.tar new-server:/home/backup/
3. Restore backup on the new server
v-restore-user admin admin.2014-01-14.tar
If you want to restore data under another user name, simply rename archive. If user name doesn’t exist on the server, account will be created automatically.
mv /home/backup/admin.2014-01-14.tar /home/backup/newuser.2014-01-14.tar v-restore-user newuser newuser.2014-01-14.tar
I was going throughout the tutorial from the vestacp website but had issues running the v-restore-user admin admin.2014-01-14.tar command to restore the data.
This is how I solved it:
- I changed directory to the /home/backup folder.
- Then I went and did the full location command: /usr/local/vesta/bin/v-restore-user admin admin.2014-01-14.tar
This is how I got this command to work.
I don’t know why, but after trying to run the command under the bin folder it didn’t worked.
Any ideas or comments why this happens leave them in the comments area.
Download the backup file.
wget --ftp-user=[USERNAME] --ftp-password=[PASSWORD] ftp://[FTP]/[FILE].tar
Restore the backup.
v-restore-user [VESTAUSER] [FILENAME]
You need to add /usr/local/vesta/bin/ to your $PATH
some installs do this automatically, sometimes they don’t.