We discovered this today and thought we would share it to help others find a solution quicker.
We have moved a client using OpenCart from a shared hosting server to a new VPS server.
Moving OpenCart Installation To New Server
- Backup current site files to local machine using FTP.
- Upload site files to new hosting server using FTP.
- Copy Database of current site.
- Create a new database on the new server.
- Import the database from the backup.
- Change the config files to ensure you have the correct information.
- DB_HOSTNAME
- DB_USERNAME
- DB_PASSWORD
- DB_DATABASE
- Change the config files directory structure information.
- DIR_APPLICATION
- DIR_SYSTEM
- DIR_DATABASE
- DIR_LANGUAGE
- DIR_TEMPLATE
- DIR_CONFIG
- DIR_IMAGE
- DIR_CACHE
- DIR_DOWNLOAD
- DIR_LOGS
- Edit you local DNS to check the site is working forcing your PC to view the website domain name at the new server.
- Edit Hostfile “C:\windows\system 32\drivers\etc\hosts
- add server IP ADDRESS ***.***.***.*** and then the domain name with and without www.
Example:-
127.0.0.1 chameleonwebservices.co.uk
127.0.0.1 www.chameleonwebservices.co.uk
Now test the site and hopefully all works.
Error: Opencart system/library/encryption.php on line 8
We got the following error “Fatal error: Call to undefined function mcrypt_create_iv() in /var/www/vhosts/#######/httpdocs/system/library/encryption.php on line 8”
We took a look at the line of code:-
$this->iv = mcrypt_create_iv(32, MCRYPT_RAND);
We then realised the new server had not go mcrypt so we needed to install this.
To do this you will need to login to the server via a program like PUTTY and run the following:-
yum update
yum install php-mcrypt*
We got:-
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
No package php-mcrypt available.
This did not work due to the package not being available so we had to use:-
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
yum local install php-mcrypt-5.3.3-3.el6.x86_64.rpm
Now we get:-
Loaded plugins: fastestmirror, security
Setting up Local Package Process
Examining php-mcrypt-5.3.3-3.el6.x86_64.rpm: php-mcrypt-5.3.3-3.el6.x86_64
Marking php-mcrypt-5.3.3-3.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
Resolving Dependencies
–> Running transaction check
—> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-mcrypt x86_64 5.3.3-3.el6 /php-mcrypt-5.3.3-3.el6.x86_64 46 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total size: 46 k
Installed size: 46 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mcrypt-5.3.3-3.el6.x86_64 1/1
Verifying : php-mcrypt-5.3.3-3.el6.x86_64 1/1
Installed:
php-mcrypt.x86_64 0:5.3.3-3.el6
Complete!
You will then need to restart your server:
service httpd restart
Now check the website and it should be up and running.