Database development site or local development

    • 8 posts
    August 28, 2020 7:06 PM EDT

    ive searched the threads but can't seem to find the answer.

    I want to move my site to a subdomain for testing but want to point to a different database so I don't mess up my live site.

    Where is it, that points the site to a particular DB?

    Im going to copy my live DB and just rename it for the dev.

     

    • 8 posts
    August 28, 2020 7:20 PM EDT

     oops, just found it..was looking in forum and not the online help...sorry for the extra thread on here

    • Moderator
    • 6923 posts
    August 29, 2020 5:06 AM EDT

    No problem! Please ensure that the subdomain is named development which is required by the license. It must be closed to the public by either being password protected or by being in maintenance mode which requires a code for access. Anything else requires purchasing another license.

     

    Where did you find the tutorial? Was it the one in our learning center?

     

    For those wondering, I do my testing on local server. I use Mamp Pro as it sets up better for mac and winblows.

     

    Here's how I do it:

    1. Install Mamp Pro (or the free version but I like Pro best).

    2. Find the install. For Mac, it is in Applications. It'll be a MAMP folder.

    3. Open the htdocs folder.

    4. Create a folder like you see above, I have several. You can have as many local installs as you need. If on a live server, you can only have one development site set up as mentioned, in a subodomain named development.

    5. Either install fresh or get your backup files and put them in the subfolder you made above.

    6. If installing fresh, make a database in mamp's phpmyadmin.

    7. Do the install as normal. 

     

    Or if from a backup then step 6 and follows are:

    First, be sure you put the backup files in the mamp folder. Which was step 5 above.

    6. Import your database from your backup into mamp's phpmyadmin. You will need to have made a database for it.

    7.  open the file application/settings/database.php (not database.sample.php) and change the values to your new database name, database user and database password.

    8. If you have a cache.php file (not cache.sample.php), then you have cache settings.

    9. Open that file if it exists and change the values so it uses file system. Around line 17 you'll see the settings to change. Here is how it is for my mamp install. You need the path to yours.

     array (
        'File' => 
        array (
          'file_locking' => true,
          'cache_dir' => '/Applications/MAMP/htdocs/phpv4/temporary/cache',
        ),
      ),
      'default_file_path' => '/Applications/MAMP/htdocs/phpv4/temporary/cache',
    ); ?>

    10. You should be able to test the site if mamp is running. You will want to clear cache. No need to set the site to maintenance mode as this is local and not necessary.

     


    This post was edited by socialenginestaff at August 29, 2020 5:08 AM EDT