Scroll

MotoCMS 3

MotoCMS eCommerce

MotoCMS Blog

Moto4

Welcome to our LiveChat! Please press "Start Chat" button to proceed

Start Chat

Connect your MotoCMS 3 website files to the existing MotoCMS 3 database

  1. In order to connect your website to the existing database, you should locate the MySQL database section in your hosting control panel and find the following credentials you'll need to use:
  • MySQL database hostname
  • MySQL database name
  • MySQL database user
  • MySQL database user's password

 

Make sure this MySQL database user has been granted ALL privileges under the chosen MySQL database!

 

2. Then, go to phpMyAdmin area through your hosting control panel and find the database with your website tables. They are (necessary, but not limited to):

content_blocks
content_taxonomies
content_taxonomy_relations
fonts
languages
media_folders
media_items
menus
menu_items
pages
pages_treepath
presets
roles
settings
styles
users

In case there's something before these names (such as "moto_" before each database table name), that is your Table Prefix and you should write it down for the future reference! So, if the list of the database tables look like it's shown below, then your table prefix is "moto_":

moto_content_blocks
moto_content_taxonomies
moto_content_taxonomy_relations
moto_fonts
moto_languages
moto_media_folders
moto_media_items
moto_menus
moto_menu_items
moto_pages
moto_pages_treepath
moto_presets
moto_roles
moto_settings
moto_styles
moto_users

Also, while you're in phpMyAdmin, make sure the server address (MySQL database hostname) corresponds the one you recorded earlier from the hosting control panel > MySQL databases section.

1.png

If it it's not the same, write this one down and to use it if the one mentioned in your hosting control panel doesn't work.

 

3. After that, please go to hosting control panel > File Manager or connect to the server via FTP to manage files, and locate the /mt-includes/config/settings.php file. Rename it to somewhat (just to keep it as a backup). Then you need to create a new /mt-includes/config/settings.php file with the following content (copy it, but don't save the file yet, you'll have to modify it before saving!):

<?php
defined('MOTO_ENGINE') or die;
define('MOTO_INSTALLED', true);

if (!isset($config))
$config = array();

/* USER_SETTINGS:START */
$config["database"]["hostname"] = 'INSERT_HOST_HERE';
$config["database"]["username"] = 'INSERT_USERNAME_HERE';
$config["database"]["database"] = 'INSERT_DATABASE_NAME_HERE';
$config["database"]["password"] = 'INSERT_PASSWORD_HERE';
$config["database"]["prefix"] = 'INSERT_PREFIX_HERE';

/* USER_SETTINGS:END */

return $config;

Obviously, in this file you should insert all of the values in the corresponding fields, inbetween the quotation marks. For example, let's refer to the previous screenshot:

1.png

I don't have any table prefix, my host at the attached screenshot 1 is "localhost" and database name is "motocm5_65559", database user is "motocm5_65559" (same as the database name) and its password is just "p@ssword", here is what I get in my file:

<?php
defined('MOTO_ENGINE') or die;
define('MOTO_INSTALLED', true);

if (!isset($config))
$config = array();

/* USER_SETTINGS:START */
$config["database"]["hostname"] = 'localhost';
$config["database"]["username"] = 'motocm5_65559';
$config["database"]["database"] = 'motocm5_65559';
$config["database"]["password"] = 'p@ssword';
$config["database"]["prefix"] = '';

/* USER_SETTINGS:END */

return $config;

 

In case some custom port (not the default MySQL database connection port 3306) is required to be used, in the file /mt-includes/config/settings.php before the line 

/* USER_SETTINGS:START */

you should add the following line:

$config['database']['port'] = 3309;

Replacing "3309" with your port number.

 

4. Once you're done modifying the new settings.php file, don't forget to save it (and upload to your server if you're using an FTP client).

 

In case there's any issue or question during these modifications, don't hesitate to contact us at support@motocms.com

We're always happy to assist!

Have more questions? Submit a request

Comments