Please disregard the 'View article...' shown at the bottom of many posts as this is the result of restoring old forum posts from a backup.

Change Database?

edited January 2016 in General Support
Is there any way to change which database Exponent is configured to?

I installed a development environment with a clean database. I have a copy of an existing 'master' database that I'd like my development environment to now point to... any advice?

Thanks.

Comments

  • edited January 2016
    There's a fairly easy way to switch between database's and configs using the 'Profiles' tab of Site Configuration, Though what you're describing may take a few steps to set up, it's how I work locally with ALL my sites and ALL the sample databases for easy access.


    1. The 'database' parameters (name, etc) are within the /framework/conf/config.php file, which can easily be edited.
    2. To create your first profile (of the current setup). go to Site Configuration, Profiles tab and type in the name for this first profile then click on the 'Save New Profile' button.
    3. Once complete, you'll notice the new profile is now in the list of available configuration profiles, and it is the one that's active.
    4. Here's the tricky part, we do NOT want to mess with the current database, so we'll have to create a new one on the server (however if you performed another install, the database or at least a bare initial one may already be on the server)
    5. If there is a second Exponent 2.x database,

    1. you can simply update the /framework/conf/config.php file params ("DB_USER","DB_PASS","DB_NAME")
    2. When you refresh the page, you'll now have your site based on the new data (you may have to log off/log on to get all the pages, etc... to be correct due to caching)
    3. After it's done you'll notice two 'profiles' in the list which you can easily switch between
    4. Import your archived database *.eql file, and perform an update/upgrade if necessary
    5. Go to the Site Configuration, Profiles, enter a DIFFERENT name and click on the 'Save New Profile' button

    6. If you do NOT have an existing second Exp 2.x database, we'll have to create one from installation.

    1. Create a new mysql database
    2. Delete the /framework/conf/config.php file (a copy was already stored in the /framework/conf/profiles folder)
    3. CREATE an empty file '/install/not_configured' to allow a new installation to take place
    4. Do a new install from /install/index.php, do NOT select one of the existing profiles to restore, and there is no need to load a sample database
    5. After it's done you'll notice two 'profiles' in the list which you can easily switch between
    6. Import your archived database *.eql file, and perform an update/upgrade if necessary
    7. Go to the Site Configuration, Profiles, enter a DIFFERENT name and click on the 'Save New Profile' button

    Now you can easily switch between 'environments' each of which has a separate 'config' which points to a different database.

    If you update any of the settings on the Site Configuration or change the theme selected, you should update/save the profile, the name of the current profile should already be filled out, so you could simply click on the Save New Profile button.
Sign In or Register to comment.