Migrating to another server

The Opalstack team can migrate your account to another Opalstack server at no cost. Some reasons to migrate to another server include:

  • Changing the type of service, such as upgrading from shared hosting to VPS hosting
  • Changing the location of your web hosting services
  • Moving to a newer operating system

Note that when you migrate to another server your server hostname and IP address will change. If you have websites on domains that use name servers other than Opalstack's, such as your domain registrar or CDN service, then you will need to update our domain's A records on your external name server to point to the new Opalstack server IP address immediately following the migration. A proxy will be set up on the original server to forward traffic to the new server while your DNS changes are pending. No action is required for domains that use Opalstack's name servers.

Also note that there is a brief period of downtime associated with the migration while we import your databases on the destination server. If you have large databases over 1 GB in size then the downtime may be longer. Because of this you may want to schedule your migration during a period when your sites receive less traffic

How to migrate

The steps to migrate to another server are:

  1. If you are migrating from a CentOS 7 server to an AlmaLinux 9 server, then take the pre-migration steps below under Migrating from CentOS 7 to AlmaLinux 9 to ensure that your apps and data are ready for the migration.

  2. Contact the Opalstack support team to schedule the migration and include the following details:

    • The date and time (with time zone) for the migration
    • The location of the server
    • If you are upgrading or downgrading, then include the plan that you want to change to.
  3. The support team will then run a pre-migration test to identify domains that don't use Opalstack's name servers and other possible issues, then confirm the schedule.

  4. If your site has a maintenance mode that you want to activate, then do so just prior to the scheduled migration time.

  5. The support team will contact you at the scheduled migration time and begin the migration.

  6. We'll notify you when the migration is complete.

  7. If you have domains that use external name servers then point those domains at your new Opalstack server IP.

  8. If you are migrating from a CentOS 7 server to an AlmaLinux 9 server, then take the post-migration steps below under Migrating from CentOS 7 to AlmaLinux 9 to get your apps up and running on the new server.

Migrating from CentOS 7 to AlmaLinux 9

The AlmaLinux operating system is much newer than the CentOS 7 operating system that runs on our older servers. The newer operating system includes newer versions of software (like PHP, Python, Ruby, MySQL, etc) and newer versions of the system libraries that all of the server software uses. Because of this, many customer applications will require prepration prior to a migration and reconfiguration after the migration.

Pre-migration

Software versions

Prior to migrating from CentOS 7 to AlmaLinux 9 you must ensure that your applications are compatible with the software on the new server. The minimum versions supported for some common languages and tools are:

  • PHP v8.3
  • Python v3.9
  • Node.js v16.20
  • Ruby v3.3
  • Go 1.21
  • Git 2.43
  • MySQL v8.4
  • PostgreSQL v17.2

Note that the following software is not supported on our AlmaLinux 9 servers:

  • Python v2.x
  • PHP v5.x
  • PHP v7.x

MariaDB databases

When migrating to AlmaLinux 9, your MariaDB databases will be converted into MySQL databases. The MySQL service uses an updated password storage format; because of this, you must update your MariaDB database passwords prior to the migration to ensure that they are stored in the updated format.

Instructions for updating your MariaDB user passwords are available at: Changing a Shell User's Password

Note that it is not necessary to change the password - instead use the current password as the new password.

Post-migration

PHP applications

PHP applications such as our standard WordPress installation require no reconfiguration following a migration to AlmaLinux 9.

PHP applications with dependencies managed by Composer may need to be rebuilt by reinstalling Composer and then reinstalling the application's dependencies. Instructions for installing Composer are available at: Installing Composer

Python 3 applications

Python 3 virtual environments must be recreated and project dependencies reinstalled following a migration to AlmaLinux 9.

What follows is an example of the shell commands necessary to do so. This example assumes that your Python application myapp is using a virtual environment named env in the app directory, serving a Django project named myproject via our standard uWSGI setup on Python 3.10.

cd ~/apps/myapp

# recreate the env
mv env env.centos7
python3.10 -m venv env
source env/bin/activate

# install uwsgi and your project dependencies
pip install uwsgi
pip install -r myproject/requirements.txt

Modify the above commands as needed when recreating the Python 3 virtual environment for your own application.

Ruby applications

Ruby on Rails and other applications that use RubyGems must have their gems reinstalled via bundle install following a migration to AlmaLinux 9. Additionally, the various scripts included with the app (start, stop, etc.) must be updated to work on the new operating system.

What follows is an example of the shell commands necessary to do so. This example assumes that your Rails application myapp is serving a Rails project named myproject via our standard Rails setup:

cd ~/apps/myapp/
sed -i -e 's/ruby32/ruby33/' setenv start_puma
sed -i -e 's/devtoolset-11//' setenv start_puma
cd myproject
source scl_source enable rails33 nodejs20
bundle config set deployment true
bundle install

Modify the above commands as needed when reinstalling the Ruby gems for your own application.

Node.js applications

Node.js applications must have their project dependencies reinstalled following a migration to AlmaLinux 9.

What follows is an example of the shell commands necessary to do so. This example assumes that your Node.js application myapp is serving a project named myproject via our managed Node.js v20 with packages managed by npm:

cd ~/apps/myapp/myproject
source scl_source enable nodejs20
npm install --force

Modify the above commands as needed when reinstalling the dependencies for your own application.

Gitea applications

Gitea applications may need to have their configuration updated to use a different path for git.

To do so:

  1. Log in to SSH as your Gitea app's shell user.
  2. Open the file ~/apps/name_of_app/custom/conf/app.ini in your preferred text editor.
  3. Locate the [git] section of the configuration.
  4. Set the PATH setting as follows:

    PATH = /usr/bin/git
    
  5. Save the file and exit your editor.

  6. Restart your Gitea application.

Other applications

Other applications may require similar changes following a migration to AlmaLinux 9, in particular:

  • Binary dependencies and may need to be reinstalled or rebuilt.
  • Configuration paths may need to be updated.

If you've migrated a custom application and aren't sure how update it then please contact the Opalstack support team for assisstance.