migrate and transfer Prestashop from localhost to online

my first post in Prestashop and it is on the actual migration after finishing site offline on the localhost

1. Go to localhost directory and find the site directory and make one zip from it so it should be like this sitename.zip

2. Login to your phpMyAdmin on localhost (http://localhost/phpmyadmin/) and choose the right database for the site and press export (Exporting tables from “template” database) i use quick and sql format

3. Create new database on your new domain (newdomain.com) and import sql file that we created pleaes note to UNCHECK this (Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. (This might be a good way to import large files, however it can break transactions.) under Partial Import

4. Edit /config/settings.inc.php on the online folder
There you should update the settings for the new database server (with your own settings instead of the examples here):

define(‘_DB_SERVER_’, ‘localhost’);
define(‘_DB_NAME_’, ‘database_name’);
define(‘_DB_USER_’, ‘database_user’);
define(‘_DB_PASSWD_’, ‘database_pswd’);

5. Upload files from step 2 (sitename.zip) to your new domain (newdomain.com) via FTP or file manager.

6. Remove all the files except index.php in /cache/smarty/compile and /cache/smarty/cache folders on your new domain (newdomain.com)

7. got to phpMyAdmin on the online site and find table shop_url and change domain and domain_ssl to the new domain and the physical_url should be / if no folders is used
The records should be:

domain = example.com
domain_ssl = example.com
physical_url = /

8. Login to your PrestaShop admin panel on new domain (newdomain.com) and check if it is working properly.

p.s when i first uploaded files and extract them on cpanel and loged to site after changing the settings.inc.php i got this error

Link to database cannot be established: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

and the solution was to make the hosting size bigger as i found that the zip that i uploaded was not extracted to the end and lot files was missing that’s it.