(Answer) (Category) Faq-O-Matic Faq-O-Matic : (Category) Administrators' Guide : (Category) Install :
How to migrate FOM to another machine
Disable the CGI stub (chmod a-x) so that you know no more changes are occuring to the FOM data on the old server.

Back up your CGI stub, metadata and serve directories on the old server.

Install a copy of them on the new server. Move them to the appropriate locations. Tweak the CGI stub, if you need to, to accomodate changes in installation locations. (Consider using .htaccess to limit access to the new FOM to you until you have it configured.)

Connect to FOM on the new server. Access the install page. Go through "define configuration parameters," and fix up any paths that have changed, and the hostname part of $serveUrl. Save those changes, and "rebuild cache files."

MOVING FOM
OK, copy of the faq from one machine to the next DOES work! Verified!
I should mention that my apache webserver is setup to serv from /var/www/html and cgi is in /var/www/cgi-bin.
Also, I have apache setup to access as nobody:nobody for USER and GROUP.
If you serve from somewhere else (e.g., your /home/joey/ directory), then you'll have to make some changes below!

INSTALL FOM ON DESTINATION MACHINE
First install faq-o-matic on destintion machine.
Complete all the setup and configure steps (just go down the list!).
Make sure you bookmark the install/configure screen when you see that option!!! You'll need this bookmark later.
Verify that it works by loading up the FAQ, but don't add anything!
It is important to verify that you can get FOM to work on the destination machine before you attempt the transfer!

ARCHIVE THE FOM SOURCE FILES
Use tar (and then gzip) to compress the files (will save permissions automatically)

        >tar -cf fomarchive /var/www/cgi-bin/fom
        >tar -cf fommetaarchive /var/www/cgi-bin/fom-meta/
        >tar -cf fomservearchive /var/www/html/fom-serve/

GET THE ARCHIVED FOM FILES TO THE DESTINATION MACHINE
Copy these over to the new location, most likely by setting up a NSF share on source machine and using mount on the other.
You have to be su to mount and the share directory needs to exist on the source. For example:

        mount kyle.southpark.com:/home/kenny/tmpshare /home/kenny/tmpshare
        [source location with NSF running ] [distination version]

UNARCHIVE FOM ARCHIVES IN YOUR DESTINATION /HOME DIRECTORY
Now use ungzip on all files (I know tar can do it! Nevermind that!)

        >ungzip *.gz
Use tar to extract directories but keep permissions, if everthing is same for source and destinatio (e.g., user & group in httpd are same):
        >tar --same-permissions -xvf *.tar
If destination apache user/group aren't the same, then see tar for how to specify new permissions for each file during extaction, or do it by had later (I'll tell you what they should be shortly).
Replace the old destination versions with the new.
My http server is nobody:nobody and the below directions will apply unmodifed if yours is setup the same. Otherwise, you'll have to change any references below to "nobody" to whatever your webserver USER is set to.

REPLACE FOM

        >rm /var/www/cgi-bin/fom
        >cp fom /var/www/cgi-bin
EDIT fom, make sure host is correct! It will be host of souce computer, and will need to be changed.
Make sure it has appropriate owner, for me it's:
        -rwxr-xr-x    root   root    fom

REPLACE FOM-META

        >rm -r -f /var/www/cgi-bin/fom-meta/
        >cp -r -reply=yes fom-meta/ /var/www/cgi-bin/fom-meta
Make sure it has appropriate owner, for me it's:
        drwxr-xr-x    nobody   root    fom-meta
For me everything *inside* fom-meta is nobody:nobody
For me everything *inside* fom-meta is -rw-r--r-- except:
        -rw-------    cookies
        -rw-------    idfile
        drwx------    RCS
Everything *inside* fom-meta/RCS is nobody:nobody and -r--r--r--

REPLACE FOM-SERVE

        >rm -r -f /var/www/html/fom-serve/
        >cp -r -reply=yes fom-serve/ /var/www/html/fom-serve
Make sure it has appropriate owner, for me it's:
        drwxr-xr-x    nobody   root   fom-serve
Inside fom-serve I have:
        drwxr-xr-x    nobody   nobody   bags
        drwxr-xr-x    nobody   nobody   cache
        drwxr-xr-x    nobody   nobody   item
Go indside the /form-serve/cache/ folder and delete all its contents. The will be recreated later. This is totally safe!!
For me, everthing *inside* /fom-serve/bags/ and /fom-serve/item/ are set to:
        -rw-r--r--    nobody   nobody 

EDIT THE CRUCIAL CONFIGURATION INFORMATION
Thinking of firing up the faq now? Don't, you might get errors.
DO the following first:
Edit lines 1 and 3 of /var/www/cgi-bin/fom so that they point to your perl interpreter and perl libraries.
Mine are

        Line1:  #!/usr/bin/perl -wT
        Line2:  use lib '/usr/lib/perl5/site_perl/5.8.0';
If the source and destination machines are setup identially, then do nothing.
Edit the /var/www/cgi-bin/fom-meta/config file and change "$serverBase" so that it points to your destination machine.
If your webpages and cgi are served from the same location on the source and destination machines, then you're done.
If the webserve stuff is different on the destination machine, there might be additional changes to make here. However, I have not tried that.
Edit the /var/www/cgi-bin/fom-meta/cronfile file and change the Perl and Perl lib path if necessary.
You will also need to change the host to reflect the destination machine. As with the config file, if your webpages or cgi are served from a different place on the new machine, you may have to change other stuff in cronfile.

REDO THE FOM INSTALL/CONFIGURATION STEPS
Now you are ready to start up the faq, but start up the INSTALL screen where you set all the config parameters.
You SHOULD have bookmarked this when you initially setup faq-o-matic on the destination machine.
If and when you are asked for your username and password, use the same email and password as you used on the sourcemachine.
Of course, this probably won't work and you'll have to choose a new password (it can be the same as the old one). FOM will email you a secret code to verify that the email is correct, just copy and paste it into the given box.
[note: if fom says that it can't access the idfile.lck, then you need to check the permissions on the fom-meta/ directory, not the idfile itself.]
Now you should be inside the FOM INSTALL (after entering the now good email and password). If your destination system is setup the same as the source, then you'll have to change very little if anything.
The host should already be changed, but check it anyway!
When you are happy, press the DEFINE button at the bottom.
Now you'll see the checklist again.

        GO THROUGH AND DO EVERY STEP IN ORDER. EVERY STEP!
When you get to the end, bookmark the new install page (yes, it will be different!).
Then go to the faq (link is after the bookmark step).
Congrats. It should work now. If not, make sure that things are where they are supposed to be.
Make sure that things have the proper permissions (use the error message to tell whether FOM can't find something or whether it can't access something).
That's it. It worked for me.
        Travis Seymour

[Append to This Answer]
Previous: (Answer) How To Run FOM on Windows
Next: (Answer) CGI server with different URL
This document is: http://www.jonh.net/cgi-bin/faqomatic/fom?file=1593
[Search] [Appearance]
This is a Faq-O-Matic 2.718d.
Hosted by SourceForge Logo and jonh.net.