如何将数据从heroku迁移到不同的vps?

时间:2018-05-26 11:13:31

标签: postgresql heroku heroku-postgres pg-restore

我有一个postgres数据库用于我在Heroku中托管的后端。我现在正在将vps更改为另一个供应商。 我使用了以下命令:

heroku pg:backups:capture
heroku pg:backups:download

获取转储文件,然后运行以下comamnd到pg_restore到远程vps postgres(我有ssh到远程服务器):

pg_restore --verbose --clean --no-acl -h localhost -p 5444 -d databasename -U databaseuser latest.dump --no-owner -x

我收到以下消息/错误:

pg_restore: creating INDEX "public.partners_address_e9624195"
pg_restore: [archiver (db)] Error from TOC entry 5465; 1259 6124214 INDEX partners_address_e9624195 vumqvdyhbbakqw
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.partners_address" does not exist
    Command was: CREATE INDEX "partners_address_e9624195" ON "public"."partners_address" USING "btree" ("businesses_id");



pg_restore: creating INDEX "public.partners_address_latitude_38918148755fccdf_uniq"
pg_restore: [archiver (db)] Error from TOC entry 5466; 1259 6124984 INDEX partners_address_latitude_38918148755fccdf_uniq vumqvdyhbbakqw
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.partners_address" does not exist
    Command was: CREATE INDEX "partners_address_latitude_38918148755fccdf_uniq" ON "public"."partners_address" USING "btree" ("latitude");



pg_restore: creating INDEX "public.partners_address_location_id"
pg_restore: [archiver (db)] Error from TOC entry 5467; 1259 6124734 INDEX partners_address_location_id vumqvdyhbbakqw
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.partners_address" does not exist
    Command was: CREATE INDEX "partners_address_location_id" ON "public"."partners_address" USING "gist" ("location");



pg_restore: creating INDEX "public.partners_address_longitude_6a1bd0c5aaf227a5_uniq"
pg_restore: [archiver (db)] Error from TOC entry 5468; 1259 6124985 INDEX partners_address_longitude_6a1bd0c5aaf227a5_uniq vumqvdyhbbakqw
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.partners_address" does not exist
    Command was: CREATE INDEX "partners_address_longitude_6a1bd0c5aaf227a5_uniq" ON "public"."partners_address" USING "btree" ("longitude");



pg_restore: creating INDEX "public.partners_addressdummy_location_id"
pg_restore: [archiver (db)] Error from TOC entry 5484; 1259 6124296 INDEX partners_addressdummy_location_id vumqvdyhbbakqw
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.partners_addressdummy" does not exist
    Command was: CREATE INDEX "partners_addressdummy_location_id" ON "public"."partners_addressdummy" USING "gist" ("location");


pg_restore: creating FK CONSTRAINT "public.partners_company partners_com_partner_id_68062c1b87fe6c02_fk_partners_partner_id"
pg_restore: creating FK CONSTRAINT "public.partners_companybankinginformation partners_comp_company_id_a85698afe499099_fk_partners_company_id"
pg_restore: creating FK CONSTRAINT "public.partners_fitnessinstantflooroffer partners_fi_business_id_db86587ff737cea_fk_partners_business_id"
pg_restore: creating FK CONSTRAINT "public.partners_partneraddons partners_par_addon_id_9f51a49f7df191c_fk_partners_addonmodel_id"
pg_restore: creating FK CONSTRAINT "public.partners_partneraddons partners_par_partner_id_409ed0f55743b48e_fk_partners_partner_id"
pg_restore: creating FK CONSTRAINT "public.partners_partner partners_partner_user_id_ca28b796442d283_fk_auth_user_id"
pg_restore: creating FK CONSTRAINT "public.partners_salonmenu partners_s_business_id_2e0ca679b0a24854_fk_partners_business_id"
pg_restore: creating FK CONSTRAINT "public.partners_sixdigitcode partners_s_business_id_345f911c3107973d_fk_partners_business_id"
pg_restore: creating FK CONSTRAINT "public.partners_trackbusinessdetails partners_t_business_id_1eb5c6794f6b1ada_fk_partners_business_id"
pg_restore: creating FK CONSTRAINT "public.recurrence_date recu_recurrence_id_4b67510aee5dda10_fk_recurrence_recurrence_id"
pg_restore: creating FK CONSTRAINT "public.recurrence_rule recu_recurrence_id_7ff1cb1803879eea_fk_recurrence_recurrence_id"
pg_restore: creating FK CONSTRAINT "public.recurrence_param recurrence_param_rule_id_5163400228e5d6ac_fk_recurrence_rule_id"
pg_restore: creating FK CONSTRAINT "public.social_auth_usersocialauth social_auth_usersocial_user_id_5af7eafade59e216_fk_auth_user_id"
WARNING: errors ignored on restore: 335

此操作是在空数据库上执行的。我做错了什么?

请帮忙!

由于

0 个答案:

没有答案