We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46577
    • 54 Posts
    I want to copy my MODX site to my local machine for development.

    Followed the instructions given at http://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

    Everything appears to go normally except when I log into manager the resources list only contains the default blank Home page and the elements list is empty, and opening the site in a browser when not logged in presents a blank page.

    My assets folder is there, MySQL database is populated with the tables imported from the live site, config file paths appear correct.

    MODX is installed in a subdirectory /var/www/html/pgh3/

    I have inserted a snippet on the home page:

    <?php
    return $_SERVER['DOCUMENT_ROOT']

    which returns '/var/www/html'

    would that be correct or should it include the subdirectory as well?

    I must be overlooking something simple.

    Any pointers are welcome!

    localhost on Ubuntu 14.04
    Apache 2.4.7
    MySQL 5.5.37
    PHP 5.5.9-1
    MODX Revolution 2.2.14-pl
    • Did you change the .haccess file and edit the RewriteBase to specify the subdirectory?
      RewriteBase /pgh3/


      1. Double-check the three config.core.php files and the config.inc.php file to make sure that ALL of the paths and URLs are correct

      2. Manually clear the core/cache/ directory

      3. Clear your browser cache and cookies for localhost
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 46577
        • 54 Posts
        Thank you for the suggestions Susan,

        in my .htaccess file I added

        RewriteEngine On
        RewriteBase /pgh3/


        The template file had comments about Apache mod_rewrite so I enabled this with

        a2enmod rewrite


        and restarted Apache.

        I have double checked the config.inc.php file, config.core.php files and config.inc.php file by comparing them line by line with a working installation in another subdirectory

        config.inc.php
        $modx_core_path= '/var/www/html/pgh3/core/';
        
        $modx_processors_path= '/var/www/html/pgh3/core/model/modx/processors/';
        
        $modx_connectors_path= '/var/www/html/pgh3/connectors/';
        $modx_connectors_url= '/pgh3/connectors/';
        
        $modx_manager_path= '/var/www/html/pgh3/manager/';
        $modx_manager_url= '/pgh3/manager/';
        
        $modx_base_path= '/var/www/html/pgh3/';
        $modx_base_url= '/pgh3/';
        
        $modx_assets_path= '/var/www/html/pgh3/assets/';
        $modx_assets_url= '/pgh3/assets/';
        


        config.core.php
        define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
        define('MODX_CONFIG_KEY', 'config');
        


        /connectors/config.core.php
        define('MODX_CORE_PATH', dirname(dirname(__FILE__)) . '/core/');
        define('MODX_CONFIG_KEY', 'config');
        


        /manager/config.core.php
        define('MODX_CORE_PATH', dirname(dirname(__FILE__)) . '/core/');
        define('MODX_CONFIG_KEY', 'config');
        

        Manually cleared the cache directory, and browser cache multiple times, logged out and logged in again, tried a different browser etc

        Still the same problem though, nothing has changed.
          • 46577
          • 54 Posts
          Ok here's a clue:

          I mentioned in my first post about a snippet in the home page, so I went digging through the database looking for that entry and found it in a table called site_content.

          Now my imported pages are in a table called modx_site_content, so I guess that somehow my table prefix has gotten mangled in the setup somehow.

          I will try to figure this out and will post if I find the solution but meanwhile any further suggestions are very welcome...
            • 46577
            • 54 Posts
            Success! I ran the setup and selected the Advanced Upgrade Install, this time specifying modx_ as the table prefix.

            I guess for anyone with the same problem, the thing to look for is a whole lot of tables in your database without the database prefix from the copied site.

            Thank you once again Susan it has certainly helped my understanding of MODX by digging around under the hood here.