Configure > Security

Database Connection

This page is only accessible to members of the "Super User" admin group.

AbleCommerce provides an easy way to connect the installation to a different database.  This can be useful if you are moving an installation or a database.  This feature allows merchants to achieve a "seamless" transfer when moving to a new location.  It also allows developers to easily work with changing databases.  The database connection information is stored in encrypted format in the ..\App_Data\database.config file.  Using the form provided, you can enter the new location, name, and password for any AbleCommerce 7 database and instantaneously re-connect to a different database.

AbleCommerce supports Microsoft SQL Server 2000 and 2005, as well as Microsoft SQL Server 2005 Express.  These databases are not interchangeable.  If you need to move from MSSQL 2000 to MSSQL 2005, you will need to export and import your data instead.

TIP:

In a development environment, or when the database connection information will not change, you can simply restore or overwrite the database with a new one.  

Before using the feature on this page, make sure you understand the consequences of entering an incorrect connection string.  YOUR ENTIRE STORE WILL STOP WORKING.  If you need help moving a database, then you need to contact your database administrator.  AbleCommerce support staff will help under the terms of paid support.  

Disable SSL before moving a database

If you are moving an AbleCommerce database, you will need to know if the target installation has a functioning SSL certificate.  If you attempt to use a database from an install that had SSL enabled and the new location does not have an SSL certificate, you will be unable to access the login page.  If this is the case, then you need to disable SSL before making a database backup.

You can disable the SSL setting in AbleCommerce by un-checking the box next to SSL Enabled in the Secure Sockets Layer (SSL) section of the Configure > Security > General page.

Edit Database Connection String

You are responsible for making sure that the specified database has the appropriate structure and data. Providing an incorrect connection string will disable your installation of AbleCommerce.

  1. From the top menu, go to the Configure > Security > Database page.

    databaseconnect.gif

  2. You can view your current connection string.  You should copy this information in case the new string doesn't work.

  3. Carefully change the information in the New Connection String field to point to the new location of an AbleCommerce 7 database.

  4. The box to Encrypt the connection string in the database.config file should already be checked, leave as-is unless you have a specific reason to un-encrypt the data. If you uncheck this setting, the connection string in the database.config file will be un-encrypted.

  5. Check the box stating, "I understand that providing an incorrect connection string can disable your installation of AbleCommerce."

  6. Click the CHANGE button.  

  7. If you have improperly entered the database connection string, the installation will break immediately.  Continue to the next section for instructions on fixing this issue.

Manually Changing the Database Connection String

The database connection string is encrypted in the file ..\App_Data\database.config and cannot be modified.  If you have incorrectly entered the database connection string, and the installation is now broken, follow the steps below.  

  1. Make a backup copy of ~\App_Data\database.config

  2. Copy the following code:
    <connectionStrings>
    <add name="AbleCommerce" connectionString="Server=yourserver;Database=yourDB;Uid=youruser;Pwd=yourPW;"ProviderName="System.Data.SqlClient" />
    </connectionStrings>

  3. Paste it into the database.config file.  (Overwrite any existing information and remove any unneeded breaks)

  4. Modify the connection string to have the correct new server, database name, username, and password information.

  5. Save the updated database.config file.

  6. Login to your AbleCommerce installation to confirm it is working properly.  If not, re-check your database settings and make any changes.

  7. Go back to the Configure > Security > Database page and check the box to Encrypt the connection string in the database.config file.

  8. Check the box stating you understand that providing an incorrect connection string can disable your installation of AbleCommerce.

  9. Click the CHANGE button.  This will re-encrypt the database connection string for added security.  

 

Related Topics

Configure > Security > General
Turn on secure SSL pages and configure credit card settings.

License Keys for AbleCommerce 7 newwindow.gif
Installing license keys for AbleCommerce.

How do I change or move an existing installation? newwindow.gif
Frequently asked question.