WordPress.org

Ready to get started?Download WordPress

Forums

Migrate multisite project from localhost to web server. (14 posts)

  1. w1nk5
    Member
    Posted 3 years ago #

    I just tried to migrate my multisite project from my local host to the live server using backupbuddy to find out it apparently isn't supported.

    How should I tackle this?

    Thanks.

  2. It isn't *officially* supported but it should still work. (I've tested it myself.)

    You may still have to go through the db and change the URL tho.

  3. w1nk5
    Member
    Posted 3 years ago #

    Any idea why after migrating website's address http://www.downtownchathamcentre.com redirects to the site on my local machine localhost/dcc?

    So weird.

  4. w1nk5
    Member
    Posted 3 years ago #

    I think I found it. The multisite options in the wp-config.php file.

    Hopefully this will solve my problem.

  5. w1nk5
    Member
    Posted 3 years ago #

    Ok... I have no idea whats going on?

    Everything extracted and the database looks good.

    I made the adjustments to the wp-config.php file and fixed the redirecting issue. However, I am getting the 'Error establishing database connection' error. And I know the database info is correct. I went as far as creating a test script as follows that connects no problem.:

    <?php
    
    $link = mysqli_connect('localhost', 'dtcc', 'password');
    if (!link)
    {
    	$error = 'Unable to connect to the database server.';
    	include 'error.html.php';
    	exit;
    }
    
    echo 'Successfully connected to database server.';
    
    if (!mysqli_set_charset($link, 'utf8'))
    {
    	$error = 'Unable to set database connection encoding.';
    	include 'error.html.php';
    	exit();
    }
    
    if (!mysqli_select_db($link, 'dtcc'))
    {
    	$error = 'Unable to locate the DTCC database.';
    	include 'error.html.php';
    	exit();
    }
    
    echo 'Successfuly connected to dtcc database.';
    
    ?>

    and my wp-config file looks like this:

    <?php
    
    define('DB_NAME', 'dtcc');
    
    /** MySQL database username */
    define('DB_USER', 'dtcc');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'password');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress.  A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
     * language support.
     */
    define ('WPLANG', '');
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', true);
    
    // Change default theme
    define('WP_DEFAULT_THEME', 'dccstore');
    
    /*************************************************************************/
    /* WordPress Network *****************************************************/
    
    /** Turn on MultiSite **/
    define('MULTISITE', true);
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.downtownchathamcentre.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    Any ideas? Does WordPress not like databases with the same name as the username?

  6. that shoudl be fine. Are you certain the webserver uses localhost & those names are correct? Does the user have all permissions on the db?

  7. w1nk5
    Member
    Posted 3 years ago #

    Well I have no issues connecting with the test script above using the exact same credentials.

    I really don't get it...

  8. w1nk5
    Member
    Posted 3 years ago #

    I'just gonna remove everything and try clean install of wordpress and see how the server handles it.

  9. Good plan. (also, is this site for Chatham NB?)

  10. w1nk5
    Member
    Posted 3 years ago #

    Negative. It is for Chatham, Ontario.

    Normal install worked fine. It has to be something backup buddy did.

  11. w1nk5
    Member
    Posted 3 years ago #

    If I were to manually transfer, should I just:

    1. Transfer all the files
    2. Edit wp-config
    3. Back up the db via phpmyadmin
    4. Perform a search and replace of localhost with new domain
    5. And run edited backup script on new server

    That's how I used to do regular WordPress sites before I bought backup buddy. Is it the same for multisite projects?

  12. #
    # Perform a search and replace of localhost with new domain

    Do that.

  13. w1nk5
    Member
    Posted 3 years ago #

    Ok. I can connect to the database after transferring manually.

    However, my new issue can be seen here: http://www.downtownchathamcentre.com/ (Internal pages not found.)

    My htaccess file is as follows:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    So what do you think? mod rewrite is disabled on the server?

  14. Either mod_rewrite isn't enabled on the server or it's not being allowed to read the htaccess file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.