Text size +/-

01 Mar 08 _ Tutorial: Moving DigiShop to a New Server


By Christopher
in BlogTorials, DigiShop

I recently had the task of moving an installation of DigiShop from one server to another. Here’s how I did it, in ten easy steps:

1) Download all the DigiShop files.

Also download any other site files that need to move to the new server to a local copy on your computer. I found the easiest way to accomplish this is to SSH to the server, zip up the store directory and download the single tar.gz file. Here’s how:

  1. SSH to the server
  2. cd to the directory that holds the folder you want to compress
  3. at the command line type: tar cvf - directory to compress | gzip > newfilename.tar.gz (obviously, replace “directory to compress” with the name of the directory you want to compress and “newfilename” with the name you want to call the archive.)
  4. this will place the new archived file in the current directory.
  5. Then use a program like Transmit to SFTP to the server and download the archive to your computer. While you’re in there, you can use the secure copy command (scp) to send the archive directly to the new server.

2) Prep the new store database.

Use phpMyAdmin or another MySQL utility to create a new database and database user for DigiShop. Write down the database name and the database user name and password.

3) Update these DigiShop files with the new file paths and database information.

conf/config.app.bootstrap.ini.php
conf/config.app.root.ini.php
conf/gatewayConfiguration.inc.php
conf/config.app.settings.ini.php
secure/conf/config.app.root.ini.php
secure/webapp.php
lib/framework/config.framework.bootstrap.ini.php

Extract your local copy of the tar.gz file to edit these files. But save a copy of the archive for uploading to the sever in the next step.

4) Upload the updated files to the new server.

Use SFTP to send the tar.gz archive to the new server. Then login to the server command line via SSH and extract the archive file (gunzip yourachive.tar.gz then tar -xvf yourarchive.tar). IMPORTANT: you may need reset the permissions on the unarchived files. On Linux-based systems use the chown command to reset the file ownership and permissions (chown -R username:groupname directory). Check the permissions for all the files and directories that DigiShop likes to have write-able (chmod 777). Now switch back to SFTP and upload just the files you updated in the last step. Overwrite the files on the server with these updated versions.

5) Close the old store.

If you have a recent version of DigiShop you’re in luck, because there’s a little check-box that will take the store offline for you. It’s in the DigiShop admin control panel under Settings > General Settings.

If you don’t have this option (I didn’t), the easiest way to close up the store is to make a static version of the cart.php page, and put a “store closed” message on that page. Simply load up cart.php in a browser, view the source, and copy-paste the code into a text editor (I use TextWrangler). Then edit the code until you have a sufficiently formatted store closed message. SFTP to your site and rename cart.php to cart2.php (or whatever), and upload your “static” version of cart.php.

6) Download the DigiShop database.

Export your DigiShop MySQL database via phpMyAdmin, or another utility so that you have a .sql file containing the structure and contents of the DigiShop database.

7) Upload and update the DigiShop database.

Using phpMyAdmin or other MySQL utility, import the .sql file that you made during the last step to the database on the new server. IMPORTANT: Now you have to update several entries in the ds_settings table in the new database to match the settings that you used in the config.app.settings.ini.php file.

8 ) Transfer the SSL certificate to the new server.

This can be a tricky process. You should have a plan for this before you even start on Step 1.

9) Run some tests on the new store.

Try adding some items to your cart and completing a test transaction on the new server. Don’t forget to make sure the admin control panel is working properly.

10) Switch the domiain’s DNS to point to the new server.

You’re back open for business!

Spread the Word:
  • Slashdot
  • Digg
  • Facebook
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Technorati
  • NewsVine



Leave a Reply