We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49515
    • 184 Posts
    Hello, an old website had its domain moved to a different IP address.

    There's no longer access to the old MODX website.

    I have FTPed all the files that were available, including the database.

    I've set up a new MODX install and need help on how to add all the files this new MODX manager?


    I did read this, but there's no way that will work. I think I needed to configure something before the old website was taken down.
    https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server [ed. note: eiger3970 last edited this post 11 years ago.]
      • 49515
      • 184 Posts
      The link https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server I think says I move the files to modx_doc_root/ Is that right? Where is this docroot thingy?
        • 49515
        • 184 Posts
        Also not sure on the database dump...what is the default target on the new MODX server.

        I usually don't edit paths, so things should be default, wherever the default is?
          • 49515
          • 184 Posts
          Updating your Config Files: https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

          Not sure on the paths still.
          'Once you've deployed files to the new server'. Where am I supposed to dump files to the new server? Default paths will be enough.
            • 49515
            • 184 Posts
            Update your Datbase https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

            Not sure on the path information to work on this section?
              • 44195
              • 293 Posts
              I assume the doc root is the web root. So that means the base directory that is available when you view the website.

              It depends on your host as to what the web root is. It's usually something like public_html or www
                I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
                • 49515
                • 184 Posts
                I checked config.core.php which is apparently where the default paths for MODX are set.

                Here's the code:
                <?php
                define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
                define('MODX_CONFIG_KEY', 'config');
                

                Interesting how there's no closing tag for php?
                  • 49515
                  • 184 Posts
                  Ok, thanks. I'll try dumping all the files in public_html and see what happens.
                    • 44195
                    • 293 Posts
                    A closing PHP tag isn't needed.

                    If it's a new host/location most likely the paths will be wrong.
                    Once you've transferred the files, you need to check the paths in:
                    config.core.php
                    connectors/config.core.php
                    manager/config.core.php

                    Check the paths and database info in:
                    core/config/config.inc.php

                    Then run setup again.

                      I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                      Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
                      • 49515
                      • 184 Posts
                      Thanks.
                      I checked those files and the default paths seem to point to MODX's root directory.
                      On the new server's path: /home/domain.com/public_html.

                      /home/domain.com/public_html/config.core.php
                      <?php
                      define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
                      define('MODX_CONFIG_KEY', 'config');


                      /home/domain.com/public_html/connectors/config.core.php
                      <?php
                      define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
                      define('MODX_CONFIG_KEY', 'config');


                      /home/domain.com/public_html/manager/config.core.php
                      <?php
                      define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
                      define('MODX_CONFIG_KEY', 'config');


                      /home/domain.com/public_html/core/config/config.inc.php
                      <?php
                      /**
                       *  MODX Configuration file
                       */
                      $database_type = 'mysql';
                      $database_server = 'localhost';
                      $database_user = 'root';
                      $database_password = 'xxxxxxx';
                      $database_connection_charset = 'latin1';
                      $dbase = 'modx';
                      $table_prefix = 'modx_domain';
                      $database_dsn = 'mysql:host=localhost;dbname=modx;charset=latin1';
                      $config_options = array (
                      );
                      $driver_options = array (
                      );
                      
                      $lastInstallTime = 1442904436;
                      
                      $site_id = 'modx5600f9742dc529.32282422';
                      $site_sessionname = 'SN5600f61e7e309';
                      $https_port = '443';
                      $uuid = '86b2969d-59f4-4e89-b4d1-ed610ab58db3';
                      
                      if (!defined('MODX_CORE_PATH')) {
                          $modx_core_path= '/home/domain.com/public_html/core/';
                          define('MODX_CORE_PATH', $modx_core_path);
                      }
                      if (!defined('MODX_PROCESSORS_PATH')) {
                          $modx_processors_path= '/home/domain.com/public_html/core/model/modx/processors/';
                          define('MODX_PROCESSORS_PATH', $modx_processors_path);
                      }
                      if (!defined('MODX_CONNECTORS_PATH')) {
                          $modx_connectors_path= '/home/domain.com/public_html/connectors/';
                          $modx_connectors_url= '/connectors/';
                          define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                          define('MODX_CONNECTORS_URL', $modx_connectors_url);
                      }
                      if (!defined('MODX_MANAGER_PATH')) {
                          $modx_manager_path= '/home/domain.com/public_html/manager/';
                          $modx_manager_url= '/manager/';
                          define('MODX_MANAGER_PATH', $modx_manager_path);
                          define('MODX_MANAGER_URL', $modx_manager_url);
                      }
                      if (!defined('MODX_BASE_PATH')) {
                          $modx_base_path= '/home/domain.com/public_html/';
                          $modx_base_url= '/';
                          define('MODX_BASE_PATH', $modx_base_path);
                          define('MODX_BASE_URL', $modx_base_url);
                      }
                      if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                          $isSecureRequest = false;
                      } else {
                          $isSecureRequest = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
                      }
                      if (!defined('MODX_URL_SCHEME')) {
                          $url_scheme=  $isSecureRequest ? 'https://' : 'http://';
                          define('MODX_URL_SCHEME', $url_scheme);
                      }
                      if (!defined('MODX_HTTP_HOST')) {
                          if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                              $http_host='www.domain.com';
                              define('MODX_HTTP_HOST', $http_host);
                          } else {
                              $http_host= array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'www.domain.com';
                              if ($_SERVER['SERVER_PORT'] != 80) {
                                  $http_host= str_replace(':' . $_SERVER['SERVER_PORT'], '', $http_host); // remove port from HTTP_HOST
                              }
                              $http_host .= ($_SERVER['SERVER_PORT'] == 80 || $isSecureRequest) ? '' : ':' . $_SERVER['SERVER_PORT'];
                              define('MODX_HTTP_HOST', $http_host);
                          }
                      }
                      if (!defined('MODX_SITE_URL')) {
                          $site_url= $url_scheme . $http_host . MODX_BASE_URL;
                          define('MODX_SITE_URL', $site_url);
                      }
                      if (!defined('MODX_ASSETS_PATH')) {
                          $modx_assets_path= '/home/domain.com/public_html/assets/';
                          $modx_assets_url= '/assets/';
                          define('MODX_ASSETS_PATH', $modx_assets_path);
                          define('MODX_ASSETS_URL', $modx_assets_url);
                      }
                      if (!defined('MODX_LOG_LEVEL_FATAL')) {
                          define('MODX_LOG_LEVEL_FATAL', 0);
                          define('MODX_LOG_LEVEL_ERROR', 1);
                          define('MODX_LOG_LEVEL_WARN', 2);
                          define('MODX_LOG_LEVEL_INFO', 3);
                          define('MODX_LOG_LEVEL_DEBUG', 4);
                      }
                      if (!defined('MODX_CACHE_DISABLED')) {
                          $modx_cache_disabled= false;
                          define('MODX_CACHE_DISABLED', $modx_cache_disabled);
                      }
                      


                      The old website's files (www/(contains all the index.php and other files) and database (domain_db.sql) were FTPed to this new server and moved to /home/domain.com/public_html.

                      When I load www.domain.com the following is shown:
                      Index of /
                      Name Last modified Size Description