...
Run DMS Docker containers
Run DMS PostgreSQL container
Requirements to run:
Common rules for all containers
- PostgreSQL data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty, then new nuxeo database will be created thereon the mounting folders.
- On Windows mounting folders must be located in C:/Users, on Mac OS X - in /Users
When you are starting the container on Windows, folder must be mounted that way (two slashes are needed for the windows path):
Code Block -v //c/users/:/path_in_container
If you operate docker on Windows with Docker Quickstart Terminal, then execution of the docker exec commands on windows must be done in the docker machine command line. if the docker machine is called "default", then you can get access to it with:
Code Block docker-machine ssh default
If you operate docker with PowerShell then this step is unnecessary.
Run DMS PostgreSQL container
Requirements to run:
- PostgreSQL backup folder must be mounted.
- Port 5432 must be exposed.
...
Code Block |
---|
docker run -p 5432:5432 \ --volume=/local_postgres_data_folder:/var/db/postgres/data \ -v /backup_folder_on_host :/backup --name postgres -d practiceinsight/dms_postgresqlnewpostgres |
If you have an running PostgreSQL database which needs to be migrated to the PostgreSQL container, the best way is to export the data first and then import to the PostgreSQL database running with the Docker container. You can mount the existing folder with PostgreSQL 9.3 database, but be sure to have backup, because the owner and permissions of these files will be changed and the data can be changed.
...
Code Block |
---|
pg_dump --host localhost --port 54335432 --username nuxeo --format custom --file "nuxeo-postgresql-db-20150916.bak" nuxeo |
...
After that, we need to copy the backup file to PostgreSQL docker containerthe backup folder on host machine:
Then you need to execute the next docker command:
Code Block |
---|
docker cp exec -i postgres pg_restore --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo /backup/nuxeo-postgresql-db-20150916.bak postgres:/opt/ |
To backup the database from the container, you need to executeWhen importing data, we need to login to the docker container first by using the command below:
Code Block |
---|
docker exec -it -ti postgres bash |
and then use the command below to import the old data (please change parameters as needed):
Code Block |
---|
cd /opt/ pg_restoredump --host localhost --port 5432 --username dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo --format custom --dbname=nuxeofile "/backup/nuxeo-postgresql-db-20150916.bak" |
...
Run DMS ElasticSearch container
...