We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    Hi,

    I was following the steps to upgrade an existing Evo site. I uploaded all the new files and folders to the server and labeled them NEW. I then labeled the existing files and folders OLD. I was then copying the old existing manager/includes/config.inc.php file to the new manager/includes folder. But somehow I accidentally deleted this file from the server!!! It does not exist anymore. If I go the site page I only get the install path for a new installation and NOT the upgrade.

    Before doing all this I did make a backup of all the tables from the MODx manager. How do I recover this? I want to get my old version of the site up and running so I can restart this upgrade more carefully this time? This is the first upgrade that has gone horribly wrong for me...

    Thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you have a backup of the site you should be able to recover the config.inc.php file from the backup.

      If you don’t have a backup of the site (really?), use any recent version’s config.inc.php file and edit the database info. If you don’t have one handy, here’s one from my localhost installation.
        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
        • 23299
        • 1,161 Posts
        I obviously got too complacent doing this. I think I am in a real mess...

        Inside my old and new manager/includes folders I only have a config_check.inc.php file and a config.inc.php.blank file. There is no config.inc.php at all.

        I did NOT back up the entire site. I did use the MODx manager backup function to create a 12_jul_11_database_backup.sql file. Obviously I still have all my images, CSS, galleries and template stuff on the server.

        If there is a way to recover the working site I would love to learn how. Specific step by step help would be great. Susan, looking at you response I see you referring to "edit the database info"? I think I need the specifics of that please...

        Max
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The first few lines of the file are the ones that have the database connection information.
          $database_type = 'mysql';
          $database_server = 'localhost';
          $database_user = 'user';
          $database_password = 'pass';
          $database_connection_charset = 'utf8';
          $database_connection_method = 'SET CHARACTER SET';
          $dbase = '`database`';
          $table_prefix = 'modx_';
          

          The database_type and database_server are probably good as they are. The database_user, database_password and dbase (database name) will definitely need to be edited. The charset needs to match your database charset and collation; hopefully it is utf8. The table_prefix only needs to be edited if you used a different prefix.

          Another solution is to do a new temporary installation in a subfolder, get that config.inc.php file and delete the subfolder.

          And always, always do a full backup of database and files before doing anything major (or minor, for that matter) to your sites.
            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
            • 23299
            • 1,161 Posts
            Thanks, this seems to be working! Still have a little house cleaning to do. I will then wait until I have backed up EVERYTHING and then do this more carefully...

            Susan, you are a lifesaver!

            Max
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I keep a quite large MODx folder (1.20Gb at this time) on my desktop; in the misc subfolder I have this config.inc.php file for emergencies. The docs subfolder holding various documentation is over 63Mb now.

              If you want to, you can generate a Unix timestamp for the $lastInstallTime = 1293897306; line - the installer just uses the PHP time() function, as well as a unique string (with the SN prefix) for the $site_sessionname = ’SN4d1f4e5394f6f’; line - the installer uses the PHP uniqid() function, which generates a 13-character string based on the current time (of installation) in microseconds.

              if (!isset ($site_sessionname)) {
                  $site_sessionname = 'SN' . uniqid('');
              }
              ...
              $lastInstallTime = '.time().';
              
              
                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