This article presents tips and guides to help you migrate between PHP versions on Simple Hosting.
A PHP 7 instance is now available with MySQL 5.6 (Percona), PostgreSQL 9.4 or MongoDB 2.4.
This document lists known differences or compatibility issues between the PHP 7 instance and other PHP instances (5.4 and 5.6).
It also provides instructions on how to migrate your code, VHOSTS and databases from an existing PHP instance to a new PHP 7 instance.
Like PHP 5.6 instances, PHP 7 instances use the UTC (Universal Coordinated Time) timezone by default.
You can change the date.timezone setting in the php.ini file to use the timezone of your choice.
For example :
date.timezone = "America/New_York"
You can install your own libraries, binaries and modules on the PHP 7 instance.
/lamp0/home/
folder/srv/data/home/
folderPHP 7 includes several differences and new features compared to older versions of the language.
We recommend that you read the official documentation to learn more:
The PHP 7 instance is very similar to the PHP 5.6 instance, to which our customers first had the opportunity to migrate from PHP 5.4.
We recommend that you take a look at the PHP 5.6 migration guide below to know more about the differences between the PHP 5.4 instance and the PHP 7 instance.
The PHP 7 instance comes with MySQL 5.6 (Percona) pre-installed. Percona Server is an optimized and stable version of MySQL 5.6.
You can learn more about MySQL 5.6 (Percona) server in their official documentation:
It should work seamlessly with data from MySQL 5.5 (the version installed in other Simple Hosting PHP images). We recommend that you test your application before migrating your production data to the new version. Please check out the guide below to learn more.
You can also opt for PostgreSQL 9.4, which comes with native support for the JSON data format. Migration from PostgreSQL 9.2 or 9.3 should work without issues – we recommend that you checkout the official documentation for more information.
http://www.postgresql.org/docs/9.4/static/upgrading.html
The information below offers guidance on how to migrate your current database to a new PHP 7 instance with PostgreSQL 9.4.
The new PHP 5.6 and PHP 7 instances require you to include the “mongodb” library. We recommend that you use Composer to manage your application's dependencies and make this process easier.
Please learn more about how to use MongoDB with PHP in the dedicated section of the instance documentation.
The following generic examples should provide some ideas about how you can test your application on your own computer or on a new Simple Hosting instance before migrating.
1 - Test locally
2 - Test on a new PHP 7 instance
You can create a new instance by selecting “PHP 7 / MySQL 5.6 (Percona)”, “PHP 7 / PostgreSQL 9.4” or “PHP 7 / MongoDB 2.4” at the following URL (you'll need to login or create a free account first):
https://www.gandi.net/hosting/simple/create
With Gandi CLI, you can run the following command replacing <tt>{instance type}</tt> with <tt>php7mysql5.6</tt>, <tt>php7pgsql9.4</tt> or <tt>php7mongodb2.4</tt>:
$ gandi paas create --type {instance type}
1 - Dump your database on the old instance
Access your instance via the SSH console or the web admin to export your databases.
2 - Create a new PHP 7 instance
You can create a new instance by selecting “PHP 7 / MySQL 5.6 (Percona)”, “PHP 7 / PostgreSQL 9.4” or “PHP 7 / MongoDB 2.4” at the following URL (you'll need to login or create a free account first):
https://www.gandi.net/hosting/simple/create
With Gandi CLI, you can run the following command replacing <tt>{instance type}</tt> with <tt>php7mysql</tt>, <tt>php7pgsql</tt> or <tt>php7mongodb</tt>:
$ gandi paas create --type {instance type}
3 - Upload your files to the new instance
Remember to upload the database dump file so you can import it on the instance.
4 - Import the database dump (or make a new one)
5 - Migrate your VHOSTS
This step will involve a bit of downtime, as it involves changing DNS settings that take their time to propagate.
Step 1 - Remove your vhosts:
https://wiki.gandi.net/en/simple/migrate#remove_the_old_vhost
Step 2 - Create the vhosts on the new instance:
https://wiki.gandi.net/en/simple/migrate#create_the_new_vhost
6 - Shut down the old instance (you will be refunded on your prepaid account)
Now that all the traffic is being sent to the new instance, you can shutdown the old instance. Your prepaid account will be credited with the pro-rated amount corresponding to the time remaining on your subscription.
We have released a new PHP instance supporting PHP 5.6 and new instance creations will default this new version.
You can still create instances running PHP 5.4, but it is now considered deprecated and we encourage our users to migrate to PHP 5.6.
We can however support PHP 5.4 until Debian 7 (the instance's base system) reaches End Of Life, which is currently scheduled for April/May 2018. We will inform our customers about any evolutions to our plans.
This document lists known differences or compatibility issues between PHP 5.4 to PHP 5.6, and provides instructions on how to migrate your code, VHOSTS and databases from an existing PHP 5.4 instance to a new PHP 5.6 instance.
PHP 5.6 instances use the UTC (Universal Coordinated Time) timezone by default.
You can change the date.timezone setting in the php.ini file to use the timezone of your choice.
For example :
date.timezone = "America/New_York"
Before we launched the PHP 5.6 instance, you could find some pre-installed binaries and libraries in /usr/local/bin/
, such as the SIPS/ATOS module.
On the new PHP 5.6 instance, you must install your own libraries/modules.
/lamp0/home/
folder/srv/data/home/
folder
This sections contains links to official PHP resources describing the changes made between versions. We will enrich it with feedback from our customers whenever we are made aware of relevant cases.
There are some slight differences between PHP 5.4 and PHP 5.6 that might impact you. To be safe, you might want to test your application with PHP 5.6 before you attempt a migration.
The following generic examples should provide some ideas about how you can test your application on your own computer or on a new Simple Hosting instance before migrating.
1 - Test locally
2 - Test on a new PHP 5.6 instance
Clients using PHP MySQL instances can automatically upgrade from PHP 5.4 to PHP 5.6. PostgreSQL and MongoDB users can learn how to perform a manual upgrade in the next section.
All your code, VHOSTS, databases, log files and snapshots will be moved to the new instance running PHP 5.6. Your billing will not be impacted either, but you can expect a bit of downtime while the new DNS settings are propagated.
If you have any doubts, follow the instructions above to test your application with PHP 5.6. If you encounter an issue that is not a code-related problem, contact our Support team (we might not be able to help you debug your application code).
In your instance's admin page, simply click on the Upgrade button to start the process.
You can use the following API methods to check if an instance can be automatically upgraded and to launch the automatic upgrade process.
1. Check if upgrade is possible
The “need_upgrade” property will be set to “true” in the “paas.list()” or “paas.info()” methods.
http://doc.rpc.gandi.net/paas/reference.html#PaasListReturn
2. Upgrade an instance
Set the “upgrade” property to “true” and call the “paas.update()” method.
http://doc.rpc.gandi.net/paas/reference.html#PaasUpdateParams
1 - Dump your database on the old instance
Access your instance via the SSH console or the web admin to export your databases.
2 - Create a new PHP instance
The PHP 5.6 instance is currently the default, so you simply have to choose between PHP PostgreSQL, MongoDB or MySQL.
The PHP 5.4 instance has been renamed to reflect is deprecation status.
More information: https://wiki.gandi.net/en/simple/create-instance
3 - Upload your files to the new instance
Remember to upload the database dump file so you can import it on the instance.
4 - Import the database dump (or make a new one)
5 - Migrate your VHOSTS
This step will involve a bit of downtime, as it involves changing DNS settings that take their time to propagate.
Step 1 - Remove your vhosts:
https://wiki.gandi.net/en/simple/migrate#remove_the_old_vhost
Step 2 - Create the vhosts on the new instance:
https://wiki.gandi.net/en/simple/migrate#create_the_new_vhost
6 - Shut down the old instance (you will be refunded on your prepaid account)
Now that all the traffic is being sent to the new instance, you can shutdown the old instance. Your prepaid account will be credited with the pro-rated amount corresponding to the time remaining on your subscription.