Skip to content

v4.0.0

Compare
Choose a tag to compare
@williamjallen williamjallen released this 29 May 18:34
9bad381

What's Changed

New Features

Administration

Performance

User Experience

Deprecations & Removals

Bug Fixes

Internals

Dependencies

Migrating from MySQL to Postgres

CDash 4.0 drops support for MySQL. If you are using MySQL, you will need to migrate your database to Postgres before upgrading to CDash 4.0. To do so, we recommend using pgloader.

Recommended procedure

We recommend performing a "dry run" of the migration ahead of time. This gives you a chance to make sure the migration will be successful, and it will help you schedule an appropriate amount of downtime with your users.

1. Install PostgreSQL server
2. Install pgloader

Installation instructions for pgloader can be found here.

Note that for large CDash databases (> 100 GB), we had better luck with the ccl build of pgloader (as opposed to sbcl). We encountered "heap exhausted" memory errors when using sbcl, and ccl seems to do a better job of memory management.

3. Write an input file for pgloader

The following sample input file worked well for us when migrating large CDash databases to Postgres.

LOAD DATABASE
     FROM mysql://<user>:<password>@<host>/cdash
     INTO postgresql://<user>:<password>@<host>/cdash

WITH include no drop, truncate, create no tables, preserve index names,
     workers = 8, concurrency = 2,
     multiple readers per thread, rows per range = 5000

  SET MySQL PARAMETERS
      net_read_timeout  = '86400',
      net_write_timeout = '86400'
  SET PostgreSQL PARAMETERS
      maintenance_work_mem to '256MB',
      work_mem to '256MB'

  CAST type tinyint to smallint,
       type timestamp to timestamp,
       type datetime to timestamptz

ALTER SCHEMA 'cdash' RENAME TO 'public'
;

Please see pgloader's MySQL-to-Postgres migration guide for more information about these configuration settings. For relatively smaller CDash databases, a simpler configuration file may work just fine.

4. Create a Postgres user and database for CDash

$ psql
# CREATE USER cdash WITH ENCRYPTED PASSWORD 'your-password-here';
# CREATE DATABASE cdash OWNER cdash;

5. Pause any asynchronous submission parsers, and put CDash in "maintenance mode"

$ systemctl stop cdash-worker
$ php artisan down

The purpose of this step is to prevent the MySQL database from changing while the migration is underway. This step should be skipped for "dry runs" of the migration process.

6. Change your database configuration to point at Postgres and initialize the database schema

Edit .env to set DB_CONNECTION=pgsql and DB_HOST to point to your new Postgres server.

Once that's done, run php artisan migrate to initialize CDash's database schema in Postgres.

7. Use pgloader to perform the migration

pgloader cdash.load

This assumes your pgloader input file is named cdash.load.

8. Take CDash out of maintenance mode and verify that the migration was successful!

$ php artisan up
$ systemctl start cdash-worker

New Contributors

Full Changelog: v3.10.2...v4.0.0