Database Provider Migration
When changing database providers, you must migrate your existing database data from your current database provider to the new provider to prevent unexpected data loss.
Posit Workbench uses the database for storing the status of users and for sharing information between servers when load balancing. It also has a schema_version table that is used to record the current database schema version so that Workbench can apply any necessary updates when installing a new version.
The following steps should be taken to perform a successful migration from SQLite to PostgreSQL:
- Create an empty database called
rstudio
in PostgreSQL (or any custom name according to your Workbench configuration). Ensure the connection credentials work for the new database. - Stop Workbench.
- Switch to PostgreSQL by modifying the
/etc/rstudio/database.conf
file. If you are storing the SQLite database in a different location be sure to keep thedirectory
option in the file during the migration. - Run the command
sudo rstudio-server migrate-db
. Watch for the output and confirm that the migration was successful. - Once the data has been imported to the new database, restart Workbench.
- Validate the active users information in the Administrative Dashboard, and/or inspect the old and new tables: schema_version, licensed_users, and revoked_cookie.
Note
The migration from PostgreSQL to SQLite is not currently supported.