Hi,
I am following this document to backup and restore the data in my local sever.
https://confluence.atlassian.com/bitbucketserver/using-bitbucket-zero-downtime-backup-829920023.html
After configuring the bitbucket server i am tried to backup and restore the data.
I got the backup file successfully.
Now i am trying to restore the data.
by running this command
./bitbucket.diy-restore.sh bitbucket-20180831-181100
[common.sh:17 -> source][infyn] DEBUG: Using vars file: './bitbucket.diy-backup.vars.sh'
[archive-tar.sh:35 -> prepare_restore_archive][infyn] ERROR: Cannot restore over existing contents of '/home/dev/zero/'. Please rename or delete this first.
Stack trace:
[./archive-tar.sh:35 -> prepare_restore_archive]
[./bitbucket.diy-restore.sh:0 -> main]
Renamed home directory to another name but again its not working getting same error.
Again and again .
so, kindly help in backup the data in bitbucket
Thank & regards
siva
sivashankar.veerasamy@infynect.com
Hi Sivashankar
From the error message, script fails at below location in archive-tar.sh
if [ -e "${BITBUCKET_HOME}" ]; then
bail "Cannot restore over existing contents of '${BITBUCKET_HOME}'. Please rename or delete this first."
fi
Have you specified the right BITBUCKET_HOME in bitbucket.diy-backup.vars.sh?
Is /home/dev/zero/ the BITBUCKET_HOME directory?
You have mentioned that you have renamed the home directory, have you renamed the above one?
Best regards,
Prasanth Thaikkalloor
Hi prasanth,
Have you specified the right BITBUCKET_HOME in bitbucket.diy-backup.vars.sh?
yes, i have specified correct path by creating a new path to restore.
dev@infyn:~/atlassian-bitbucket-diy-backup$ ./bitbucket.diy-restore.sh bitbucket-20180906-165224
[common.sh:17 -> source][infyn] DEBUG: Using vars file: './bitbucket.diy-backup.vars.sh'
[archive-tar.sh:35 -> prepare_restore_archive][infyn] ERROR: Cannot restore over existing contents of '/home/dev/Zero/'. Please rename or delete this first.
Stack trace:
[./archive-tar.sh:35 -> prepare_restore_archive]
[./bitbucket.diy-restore.sh:0 -> main]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumaravel
This is interesting! Can you please check whether the directory exists after the restore run fails or it just returns true for a non-existing directory?
if [ -e "${BITBUCKET_HOME}" ]
You may also check whether there are any other section in the back up script that creates this directory.
Try running below also and see what it returns
if [ -e /home/dev/Zero/ ]; then echo "Exists"; else echo "Doesn't exist"; fi
You may also run it for an existing and non existing directory and check what it returns.
-Prasanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi prasanth,
Thanks for your reply
I tried the above approach
the home directory exit.
./bitbucket.diy-restore.sh bitbucket-20180827-205924
[common.sh:17 -> source][infyn] DEBUG: Using vars file: './bitbucket.diy-backup.vars.sh'
Exists
[archive-tar.sh:35 -> prepare_restore_archive][infyn] ERROR: Cannot restore over existing contents of '/home/dev/Zero'. Please rename or delete this first.
Stack trace:
[./archive-tar.sh:35 -> prepare_restore_archive]
[./bitbucket.diy-restore.sh:0 -> main]
Again Renamed the folder called bithome
dev@infyn:~/atlassian-bitbucket-diy-backup$ ./bitbucket.diy-restore.sh bitbucket-20180827-205924
[common.sh:17 -> source][infyn] DEBUG: Using vars file: './bitbucket.diy-backup.vars.sh'
Exists
[archive-tar.sh:35 -> prepare_restore_archive][infyn] ERROR: Cannot restore over existing contents of '/home/dev/bithome'. Please rename or delete this first.
Stack trace:
[./archive-tar.sh:35 -> prepare_restore_archive]
[./bitbucket.diy-restore.sh:0 -> main]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.