I had a second go at moving all my accounting from my TiBook to my sleepless Powerbook yesterday.
The first attempt seemed to had gone quite ok, but the moment I started doing accounting things started acting really weird.
What I did was;
- I made a backup of the PostgreSQL DB
- I updated the SQL-Ledger installation on the TiBook to the latest version
- I installed the latest version on the new Powerbook
- I made a new backup of the PostgreSQL DB on the updated Powerbook
- I imported the backup onto the installation on the Powerbook
Everything looked ok, even some of the trouble I had experienced with rounding and currencies seemed to go away with little effort.
But then some of the new posts started so show wrong data and some of the balances looked weird...
The problem is simply that the backup you can perform from inside SQL-Ledger. I have not investigated whether it is just a wrapper for pg_dump or whether pg_dump creates the same result, does not seem to be in balance with the value of it's sequences
The sequence:
logicLAB=# select * from id;
sequence_name | last_value | increment_by | max_value |
min_value | cache_value | log_cnt | is_cycled | is_called
---------------+------------+--------------+---------------------
+-----------+-------------+---------+-----------+-----------
id | 10076 | 1 | 9223372036854775807
| 1 | 1 | 0 | f | t
(1 row)
The maximum trans_id from acc_trans:
logicLAB=# select max(trans_id) from acc_trans;
max
-------
10994
(1 row)
logicLAB=#
But anyway the sequences set by the dump where not aligned with the actual data also in the dump, meaning you would overwrite some transactions, loosing data...
Not good, I have now manually set the seq, to a high value, this is just a heads-up for any possible SQL-Ledger users out there.
I will have to investigate the state of the installation on the TiBook at some point.