summaryrefslogtreecommitdiff
path: root/UPGRADE
blob: 14e672f614c78c983c65bc9246d478610d1500f4 (plain)
  1. Upgrading to LedgerSMB 1.2
  2. From LedgerSMB (1.1.1 or earlier)
  3. or
  4. SQL-Ledger (2.6.19 or earlier)
  5. This document contains information on how to upgrade from earlier versions of
  6. LedgerSMB or SQL-Ledger. This upgrade is a major revision and may not go
  7. smoothly. We recommend that the reader start by reading the section on manual
  8. installation and then start by trying the automated means mentioned later.
  9. Also this document assumes that the reader is already familiar with the release
  10. notes. If you have not already done so, please read the release_notes file in
  11. the doc/ directory.
  12. Before you begin, make sure that you are running at least PostgreSQL 8.0. If
  13. you are running a prior version, you will need to dump your data, upgrade the
  14. database server and restore the data before proceeding.
  15. MANUAL UPGRADE:
  16. ===============================================================================
  17. 1) Back up old installation
  18. THis is a major upgrade. If something goes wrong, you want to be able to get
  19. back to a known good state. To back up the old installation do as follows:
  20. a) Copy the LedgerSMB install directory (for example /usr/local/ledger-smb)
  21. to another location
  22. b) Back up the database using pg_dump or other PostgreSQL backup program.
  23. c) (optional) Make a live bakup of the accounting database by creating a new
  24. db with it as the template. Something like:
  25. createdb -U postgres -T ledgersmb accounting_backup
  26. 2) Check New Dependencies
  27. The Build.PL script can be used to test for unmet dependencies and run other
  28. tests. It doesn't install anything yet, but it will tell you what you are
  29. missing. To check for dependencies, run "perl Build.PL" from the command line.
  30. Missing dependencies can generally be installed via a Linux distributor's
  31. package manager or by CPAN.
  32. Once this is done and dependencies are satisfied, you can check to see whether
  33. the installation nominally works by running "./Build test" from the command
  34. line. The test suites currently check to make sure all the perl modules load
  35. and that a number of numeric tests are passed.
  36. Dependencies which are recommended are needed only for specific functionality
  37. and may not be required in all circumstances. These include:
  38. * Net::TCLink for credit card processing in a POS environment
  39. * Parse::RecDescent for the CLI script host
  40. 3) Upgrade database
  41. a) cd to the sql/legacy/ directory of the new ledger directory
  42. b) run "psql" with appropriate options to connect to your database.
  43. c) Note the db version by running the following query:
  44. "SELECT version FROM defaults;"
  45. d) Run the SQL upgrade scripts in order starting with the one whose name
  46. begins with "Pg-upgrade-[version]" (each of these scripts will upgrade to
  47. the next database version which is also identified in the file name).
  48. Note that this will create three tables that may not actually be used depending
  49. on your setup: users, users_conf, and session. In general if you have multiple
  50. datasets, these tables will only be used in one.
  51. 4) Decide where to put the user/session management tables. In general, we
  52. recommend as follows:
  53. a) Single dataset installations should use the user tables in the dataset.
  54. b) Multicompany installations should use user tables in a separate dataset
  55. from any accounting data.
  56. If you need to create another dataset, you can create the db and import the
  57. sql/Pg-central.sql file into it.
  58. 5) Set the admin password:
  59. a) From psql, determine what admin password you wish to use. Then type:
  60. "update users_conf set password = md5('my_password');"
  61. Naturally you would use your password instead of my_password.
  62. 6) Import the users. Run the import-members script to do this.
  63. 7) Copy the files from the LedgerSMB tarball over your existing installation.
  64. 8) Delete the users directory.
  65. 9) Upgrade your templates. Run the following command:
  66. perl upgrade_templates.pl $templatedir
  67. Where $templatedir is the directory of your templates.
  68. 10) Edit the ledger-smb.conf file as appropriate.
  69. 11) You can test basic parts of the installation by running Build ./test at
  70. this point.
  71. Congratulations, you have manually upgraded to LedgerSMB 1.2.
  72. TODO: Add upgrade.pl script and automate the above process.