Are you restoring into an empty database?

On 2 May 2018 at 15:17, Syed Nabi <[email protected]> wrote:

> How to restore a backup of h2 database in java. I store the backup on
>
> statement.execute(String.format("SCRIPT TO '%s'","path.sql"));
>
> but I don't know how to restore this backup I tried
>
> statement.execute(String.format("RUNSCRIPT FROM '%s'", "path.sql"));
>
> but it gives me an error:
>
>  org.h2.jdbc.JdbcSQLException: Sequence 
> "SYSTEM_SEQUENCE_072EDF24_6F60_47A3_A01C_3013DBBD9743" already exists; SQL 
> statement:
>     CREATE SEQUENCE 
> PUBLIC.SYSTEM_SEQUENCE_072EDF24_6F60_47A3_A01C_3013DBBD9743 START WITH 10 
> BELONGS_TO_TABLE [90035-197]
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to