Adding entries in the database manually is not advisable.
There are other table fields that affect next reference number for new transactions and the audit_trail table. If, however, you still need to do it, then in another dummy company, add a bank account and compare the before and after sql backups to identify what changed and do likewise appropriately in your actual company.
Only one GL Account can be mapped as one Bank Account. Create the GL Account first and then assign the Bank Account.
This way there will be no errors like "GL Accounts already in use".
Adjustment entries (Journal Entries) to match the Opening Balance can be done at the close of the previous fiscal so that all carried over Balance Sheet entries in the new fiscal will be correct. Such entries however will not have the tracking capability for allocations in AR and AP and their reports on ageing.
Make sure you have all the GL entries and the Bank Accounts setup and only then import your transactions.
Have all the fiscal years too available and make sure you have the option to enter transactions in earlier fiscal years enabled in the role permissions.