Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ ASK ] How To backup volume then restore it to different Computer #103

Open
fahmyabdul opened this issue Aug 8, 2018 · 1 comment
Open

Comments

@fahmyabdul
Copy link

fahmyabdul commented Aug 8, 2018

I'm new in using Docker,
I want to backup volume from Server Computer to User Computer (From Different Computer), the step that I have done :

Running docker container with this command on Server Computer :
docker run --restart=always -d -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true --mount source=oracle_vol,target=/u01/app/oracle wnameless/oracle-xe-11g:latest

Then I backup the volume with this command :
docker run -it --rm -v oracle_vol:/volume -v /home/server123/backup/:/backup wnameless/oracle-xe-11g:latest tar -cjf /backup/orclvols_archive.tar.bz2 -C /volume ./

Then I copy the .tar.bz2 to User Computer and restore the volume with this command :
docker run -it --rm -v oracle_vol:/volume -v /home/user123/backup_docker/:/backup wnameless/oracle-xe-11g:latest sh -c "rm -rf /volume/* /volume/..?* /volume/.[!.]* ; tar -C /volume/ -xjf /backup/orclvols_archive.tar.bz2"

Then run container in User Computer with command :
docker run --restart=always -d -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true --mount source=oracle_vol,target=/u01/app/oracle wnameless/oracle-xe-11g:latest

And I got this error :

ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where ::= [/][@<connect_identifier>]
::= [][/][@<connect_identifier>]
/usr/sbin/startup.sh: ignoring /docker-entrypoint-initdb.d/*

If I backup & restore it on the same Computer, I got no error and it run smoothly.

So how to backup the volume Then restore it on different computer? Is it possible?

I use this https://loomchild.net/2017/03/26/backup-restore-docker-named-volumes/ as reference.

Thanks

@ryanfernandes09
Copy link

hey did you get this resolved? i've got the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants