Skip to content

Latest commit

 

History

History
95 lines (53 loc) · 3.12 KB

migration_guide_to_3_0.md

File metadata and controls

95 lines (53 loc) · 3.12 KB

Guide to migrate XTENS 2 from 2.3 TO 3.0

System Prerequisites:

The following software packages are required to be installed on your system:

Installation (ubuntu server):

  • Download the release 3.0

  • Move into xtens-app directory:

      cd xtens-app
    
  • Install npm packages:

      npm install && npm install sails
    
  • Install bower packages:

      bower install
    
  • Load the bower packages:

      grunt bower
    
  • Create logs folder

      mkdir logs
    

Istructions for Database

  • Login with postgres user:

      sudo su postgres
    
  • Create a backup of existing XTENS database:

      pg_dump xtensdb > /path/xtens_db_backup.sql
    
  • Create a new database:

      createdb xtensdb-3-0 -O xtensuser
    
  • Import the backup into new database:

      psql xtensdb-3-0 < /path/xtens_db_backup.sql
    
  • Run the script to execute migration:

      psql xtensdb-3-0 < /path-xtens-app-folder/scripts/migration/db_migration_pooling_from_2_3_to_3_0.sql
    
  • Copy from old XTENS folder, config/local.js file and modify the database configuration with the new database name (e. from xtensdb to xtensdb-3-0):

      ...
      connections: {
    
          'default': 'postgresql',            //your default database connection
    
          postgresql: {                       //your database connection
    
              adapter: 'sails-postgresql',           
              host: '127.0.0.1',                       
              port: '5432',                  
              user: 'user',                   
              password: 'password',           
              database: 'xtensdb-3-0',      //NEW DB NAME
              schema: true
          },
      },
      ...
    
  • Finally, set your connection in the config/models.js file

        module.exports.models = {
    
            migrate: 'safe',      
            connection: 'postgresql'  // your db connection name
    
        };
    
  • Start the application:

        NODE_ENV=production forever start app.js