Loading SQL Ledger

From LinuxServerTech

Jump to: navigation, search


How to convert from previous version of SQL-Ledger

In case of conversion of SQL-Ledger to new system, following steps will be done. Note, this is not for a simple upgrade, but to actually move from one machine to another and a different version. The example below was used when converting from a Debian package (very old version) to a downloaded and installed system on new server.

  1. Install SQL-Ledger on new system, create a database, and a user access. In this document, the database "accounting" will be used.
  2. On the original system, perform a backup. Save the sql file generated to the new (target) machine. All work on source system is complete, and the remainder of the instructions should be performed on the target machine.
  3. Lock the system (Administrative function)
  4. From the command line, become the postgres user (su - postgres)
  5. Drop the existing database (dropdb accounting)
  6. Recreate the empty database with the sql-ledger user as owner (createdb -U sql-ledger accounting)
  7. Execute psql ash the sql-ledger user, inputting the file generated in step 2 as input (psql -U sql-ledger accounting < filename). This will generate a long list of messages as the database is being loaded.
  8. From the web interface, with the database still locked, enter PG Database Administration
  9. Select Update Data Set. If more than one dataset is listed, select the correct dataset, then choose "Continue"
  10. Unlock the system and verify correction function.

Note: Users are not stored as part of the database. you must add users manually. Also, if any templates were modified, they must be moved. They are located in the sql-ledger root, under templates directory. On a standard Debian install, they are in /usr/lib/sql-ledger/templates/{username}. Under a "normal" install (from source), they are in installdir/templates/{username}

Personal tools