5.4. Setup the development catalog
Now we have a branch in CVS, but we need to tie it to something in the real world, namely, an Interchange catalog.
5.4.1. Importing the catalog
Like we did in
5.4.1.1. Checkout source code
cd /var/lib/interchange cvs co -d foundation_dev foundation
5.4.1.2. Copy any other needed directories to complete the catalog
Depending on how complete your catalog is in CVS, you may need to create or copy directories/files.
cd /var/lib/interchange/foundation cp -a catalog.cfg orders/* \ /var/lib/interchange/foundation_dev
Note: A lot of the following steps are performed by the /usr/local/interchange/bin/makecat script, but here is how to do it manually:
5.4.2. Setting up a separate database
Most often, I find it profitable to make use of a second database for the development catalog, rather than having both catalogs reference the same database (especially if the first catalog is live).
5.4.2.1. Create a second database
Use the means of your database platform to create a separate database. For example, PostgreSQL users might do something like:
createdb foundation_dev
5.4.2.2. Populate the database
You can rely on the catalogs internal products/*.txt data to generate the database tables and populate them, or you can export another catalog's database and import it for the development catalog, like the example below for PostgreSQL users.
pg_dump foundation > ~/foundation.dump psql foundation_dev < ~/foundation.dump
5.4.3. Copy the catalog support files
#Must be root su - root #Copy HTML cd /var/www/html/ cp -a foundation foundation_dev #Copy CGI cd /var/www/cgi-bin cp -a foundation foundation_dev
5.4.4. Configure the Interchange daemon
Many development catalogs will branch at the same time that they upgrade to a new Interchange daemon version. But for whatever interchange daemon version you use, perform the necessary modifications to interchange.cfg. For example:
/usr/local/interchange/interchange.cfg: Catalog foundation /var/lib/interchange/foundation /cgi-bin/foundation Catalog foundation_dev /var/lib/interchange/foundation_dev /cgi-bin/foundation_dev
5.4.5. Configure the catalog specifics
The development catalog will differ at least a little bit from the standard catalog, such as in the CGI_URL and database parameters. You can also modify/add the foundation_dev/variable.txt instead of the following.
/var/lib/interchange/catalog.cfg: Variable CGI_URL /cgi-bin/foundation_dev Variable IMAGE_DIR /foundation_dev/images Variable SQLDSN dbi:Pg:dbname=foundation_dev Variable SQLDB foundation_dev
Now you can restart interchange to make your changes take effect.