======Move VPOP3 Version 5 (or later) to a new PC====== Moving VPOP3 Version 5 or later to a new PC is slightly different from [[Move VPOP3|moving earlier versions]], because of the database system, which was introduced for version 3 and modified for version 5. The summary of steps is: - Stop VPOP3 on the original PC - Manually make a backup of the database on the original PC - Copy the VPOP3 directory tree from the original PC to the new PC **except for the VPOP3\pgsql directory** and any old copies of the pgsql directory (eg 'pgsql83' or 'pgsql_v711upg') - Install VPOP3 on the new PC, **but do not start VPOP3 yet** - Restore the database backup (from step 2) on the new PC - Check settings on new PC - Start VPOP3 on the new PC - Disable VPOP3 on the old PC if necessary Please make sure you follow these instructions in the correct order. Many problems with moving installations are because people have thought we have got it wrong, and so do things in a different (incorrect) order. If you want, we can do this move for you via remote access. The charge for us to do that is currently [[https://www.pscs.co.uk/buy/ASSTMOVE|£50 (+ VAT)]]. If you want us to do this, make sure that it is possible to copy files between the PCs on your network (or have copied all the necessary files beforehand). Copying the files over the Internet to our office and then back again is not feasible given the large amounts of data that can be present. You can follow most of these steps if VPOP3 was on a PC that died, and you are moving it to a replacement PC. However, this is less ideal than [[restore_a_backup_of_vpop3|restoring from the latest daily backup]] you made. If you were not previously backing up VPOP3, this may be a [[http://www.pscs.co.uk/products/bfw/index.php|good time to start]]... =====Stop VPOP3===== First of all [[stop VPOP3]] on the original PC =====Backup the database===== To backup the database, go to a command prompt on the VPOP3 computer, and go to the VPOP3 directory. Then run pgsql\bin\pg_dump -F c -p 5433 -v -U vpop3 -f database.dmp vpop3 //Note: the above line (and all subsequent database command lines on this page) assume port 5433 is being used. This will work in the majority of cases, but in certain circumstances, a different port number may be required.// At the password prompt, type **vpop3pass** (This assumes a standard installation, if your PostgreSQL installation is non-standard, then you may need to change this command appropriately). Note that for security reasons, the password will not be displayed as you type it in. This will create a file 'database.dmp' containing a backup of the database in the VPOP3 directory so it will be copied by the next step (NB. If you are moving VPOP3 because the old computer died and you can't do this step, then (by default) VPOP3 makes backups into the VPOP3 directory called DBBACK-x.DMP, you can use the latest one of those files instead) =====Copy the VPOP3 directory tree===== How you do this depends on your network setup. The easiest way to copy it all except for the VPOP3\pgsql directory is often to copy everything, then delete the VPOP3\pgsql from the **new PC** after the copy has finished. Also, do not copy any other 'pgsql' directories which may be left over from previous upgrades - eg 'pgsql83' or 'pgsql_v711upg' Note that if you are moving to Windows Vista/2008/7 or later, we **strongly** recommend that you do not copy the files to the 'Program Files' (or 'Program Files (x86)') folder on the new PC as that can cause problems for VPOP3, because Windows has restrictions on what can be put into these folders. (Maybe copy it to a **C:\VPOP3** folder instead) =====Install VPOP3 on the new PC===== Install VPOP3 on the new PC as normal, but: * Make sure you install into the same directory that you copied the VPOP3 directory tree to, so if you copied it to D:\VPOP3, make sure you install to D:\VPOP3. Most problems with moving VPOP3 are because this step is not followed correctly. * If the installer asks you to enter your licence key, you should enter it here. If you do not enter it, make sure you choose the correct edition of VPOP3 - VPOP3 Basic or VPOP3 Enterprise * During the component selection stage of the installation, make sure you **check** the 'Database Server for VPOP3' option. Sometimes this will not be checked by default during a move operation * At the end of the install, make sure you **uncheck** the **Start VPOP3** option, so that VPOP3 does not run * If you are wanting to install a later version of VPOP3 as well as moving VPOP3, then at this step you would install the later version rather than the original version. =====Restore the Database Backup===== First, **delete the DBCHANGES.DAT file** from the VPOP3 directory (if it exists). This contains settings changes wanted by the installer, but they will overwrite the restored data, so you do not want them to take effect in this scenario. Then, on the new PC, open up a command prompt and go to the VPOP3 directory. Then run pgsql\bin\pg_restore -p 5433 -U postgres -C -v -d postgres database.dmp At the password prompt, enter ''pgsqlpass'' This will import the data to the database system on the new PC Note that during this step you may see a couple of errors which are not important: there may be an error about the database already existing, and also an error that the 'plpgsql' language is already installed. (Each of these errors may have several lines in the output). If there are lots of errors, then there may be a problem and you should contact support@pscs.co.uk. ====If you had previously installed VPOP3 on the new computer==== If you had previously installed VPOP3 on the new computer (which is not recommended), then you need to "drop" the existing database **before** restoring the database from the old computer as above. To drop the database, on the new PC, open up a command prompt and go to the VPOP3 directory. Then run pgsql\bin\dropdb -p 5433 -U postgres vpop3 At the command prompt, enter ''pgsqlpass'' In this case, you will need to create the VPOP3 database again during the restore: pgsql\bin\pg_restore -p 5433 -U postgres -C -v -d postgres database.dmp At the command prompt, enter ''pgsqlpass'' ====Moving installation directory==== If you are installing VPOP3 in a different directory on the new PC than it was on the old PC, you need to change some settings. This needs a little utility. You can download it from http://www.pscs.co.uk/downloads/vpop3settings.zip . Download this file, and extract the contents into the new VPOP3 installation directory At a command prompt, find the VPOP3 installation directory and run vpop3settings replacepaths e.g. Run vpop3settings replacepaths c:\vpop3 d:\vpop3 The utility will display all the settings which used the old location and ask if you want to change them to the new location. Check the settings, and press 'Y' if they are correct =====Check Settings on new PC===== You should check for common potential issues on the new PC - see the [[install VPOP3|installing VPOP3]] topic for details. =====Start VPOP3===== Finally [[start VPOP3]] =====Disable VPOP3 on the old PC===== If the old PC will still be being used for other things, and you do not want VPOP3 to run on it, you should disable VPOP3 on it. If you don't do this, you may end up with two copies of VPOP3 running at the same time, which will almost certainly cause strange things to happen. There are two main options here: - Disable the VPOP3 service - Uninstall VPOP3 ====Disable the VPOP3 service==== Go to **Control Panel -> Administrative Tools -> Services** on the //OLD// computer Find the **VPOP3** service. Double-click it. If the Service Status is 'Started', press the**Stop** button. In the **Startup type**, choose **Disabled** and press **OK** Find the **VPOP3DB** service and do the same again ====Uninstall VPOP3==== Only uninstall VPOP3 if you will not want to run VPOP3 on this computer again, as it will clear all the data. Go to **Control Panel -> Programs and Features** on the //OLD// computer Find the 'VPOP3' program and uninstall that. =====More information===== The documentation for the PostgreSQL utilities can be useful: http://www.postgresql.org/docs/9.1/static/reference-client.html