...
- Be sure, that user that launches docker container has write permissions on 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 on Windows or Mac OS X
Requirements to run:
- PostgreSQL backup folder must be mounted.
- Port 5432 must be exposed.
...
Code Block |
---|
docker run -p 5432:5432 -v /backup_folder_on_host :/backup --name postgres -d newpostgrespracticeinsight/dms_postgresql_winmac |
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.
...
Then you need to execute the next docker command:
Code Block |
---|
docker exec -iit postgres pg_restore --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo /backup/nuxeo-postgresql-db-20150916.bak |
To backup the database from the container, you need to execute:
Code Block |
---|
docker exec -tit -i postgres pg_dump --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo -Fc --file "/backup/nuxeo-postgresql.bak" |
There is also automatic backup script that is disabled by default, to enable it you need to execute the next command:
Code Block |
---|
docker exec -it postgres chmod +x /etc/services/backup/run |
After script enabling it will start to make the backup copies of the nuxeo database to the backup folder every hour.
If you want to change the parameters if the backup script (such as backup format, password, time delay between backups), you can easily do it with the next command:
Code Block |
---|
docker exec -it postgres vim /etc/services/backup/run |
To stop the automatic backups you just need to:
Code Block |
---|
docker exec -it postgres chmod -x /etc/services/backup/run |
Run DMS PostgreSQL container on Linux
DMS Postgresql for Linux is a container that is similar to a WinMac one, but all the data files of the postgresql are located in the folder of host machine.
Run DMS ElasticSearch container
...