How to migrate to the new Universal Container
This page is intended for users of the legacy pwpush-ephemeral
, pwpush-postgres
and pwpush-mysql
Docker container images.
If you are already using the pwpush
container, you can safely ignore this page.
New Universal Docker Container
In release v1.32.0 a new universal container (pglombardo/pwpush) was introduced.
This container replaces the legacy pwpush-ephemeral
, pwpush-postgres
and pwpush-mysql
containers. But don’t worry - migration is easy.
Note: The legacy containers have been deprecated and are no longer updated
tldr; To use the new universal container:
docker run -p "5100:5100" -e DATABASE_URL=<read-below> pglombardo/pwpush:latest
Whats the Difference?
The legacy containers bundle only one database driver each - the one respective to their backend flavour.
The new universal container bundles all database driver types together. This greatly simplifies the release, maintenance and end-user experience.
How does it work?
The universal container decides on which database driver to use based on the environment variable value of DATABASE_URL
. Each of the legacy containers already have this environment variable set.
Some examples:
# PostgreSQL
DATABASE_URL=postgresql://pwpush_user:pwpush_passwd@postgres:5432/pwpush_db
# MySQL (note the prefix 'mysql2')
DATABASE_URL=mysql2://pwpush_user:pwpush_passwd@mysql:3306/pwpush_db
# MariaDB (note the prefix 'mysql2')
DATABASE_URL=mysql2://pwpush_user:pwpush_passwd@mariadb:3306/pwpush_db
# SQLite3 (ephemeral/lost on container restart)
DATABASE_URL=sqlite3:db/db.sqlite3
Note: If DATABASE_URL
isn’t specified, the container will default to the ephemeral backend using SQLite3. In that scenario all data is lost on container restart (which is desired in some cases).
How to Migrate
- To be safe, make sure to have a backup of your data.
-
Validate the existence of
DATABASE_URL
in your existing deploymenta. If using PostgreSQL, MySQL or MariaDB,
DATABASE_URL
must be set to one of the values in the previous sectionb. If using Ephemeral (data lost on container restart),
DATABASE_URL
is not required or alternativelyDATABASE_URL=sqlite3:db/db.sqlite3
- Simply change the configured docker container image to pglombardo/pwpush and restart
- Validate container output for any errors or warnings
- Once the application is booted, validate that your pre-existing data is still there.
Troubleshooting
If you have any trouble migrating or with the universal container we want to know! Please file an issue and we will help you the best we can.