How to run load database command of pgloader in a terminal while migrating data?

628 views Asked by At

I want to migrate data from SQLite to PostgreSQL and I decided to use pgloader for that.

However, the instructions are so poor that I do not know how to execute this command:

load database
     from sqlite:///Users/dim/Downloads/lastfm_tags.db
     into postgresql:///tags

 with include drop, create tables, create indexes, reset sequences

  set work_mem to '16MB', maintenance_work_mem to '512 MB';

It throws an error that load command not found or if I run it with pgloader load it throws an error to check the available options with pgloader.

1

There are 1 answers

0
Prashant Swarnapuri On

The script you posted should be saved as file. Lets assume you save that as lastfm_tags.load.

Then you can run it as pgloader lastfm_tags.load