143 Members
https://github.com/dessalines/lemmy43 Servers

Load older messages

Timestamp Message
4 Apr 2020
In reply to @nutomic:matrix.org
afxjzs: copying the folder always worked for me, but do a postgres dump if you want to be sure
another dumb question: how are you getting access to psql? i'm ssh'd into the machine, but i can seem to run pg_dump either directly or through docker. what command would you use to export the data?

trying to do a backup and ssh'd into the machine and ran sudo docker exec lemmy_postgres_1 pg_dump -U lemmy lemmy > db_backup.sql but the db_backup.sql file doesn't have any of the data in it. it does have sql in it tho:

-- PostgreSQL database dump

-- Dumped from database version 12.2
-- Dumped by pg_dump version 12.2

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

-- PostgreSQL database dump complete
03:24:37@afxjzs:matrix.orgafxjzs this command also runs successfully but the output file does not have the content of the database: sudo docker exec lemmy_postgres_1 pg_dumpall -U lemmy > db_backup_all.sql
03:58:53@happydooby:matrix.orgDessalinesI just added this today. https://dev.lemmy.ml/docs/administration_backup_and_restore.html
04:00:05@happydooby:matrix.orgDessalines it should be exec -t and do a docker ps to check the correct db container name
04:00:48@happydooby:matrix.orgDessalines And it should be pg_dumpall
In reply to @happydooby:matrix.org
I just added this today. https://dev.lemmy.ml/docs/administration_backup_and_restore.html
thanks so much for all your help on this. here's a gist of the console and output. it shows the container name as lemmy_postgres_1 and i ran the command from the file you linked. the .sql file is larger, but still doesn't seem to have any real data in the export. https://gist.github.com/afxjzs/6865d4d5c36d8240084db77071b6c065
04:42:32@happydooby:matrix.orgDessalines I'd try to do docker exec -it lemmy_postgres_1 psql -U lemmy and make sure the tables are there, bc that looks empty.
04:43:42@happydooby:matrix.orgDessalines If you used a custom postgres user it might be -U user_name
04:46:12@happydooby:matrix.orgDessalines afxjzs: I'm also seeing a second docker database container called lemmy_lemmy_db_1
04:47:29@happydooby:matrix.orgDessalines I'd export the data from that, and do an import into the other one, then remove lemmy_lemmy_db_1
04:55:11@afxjzs:matrix.orgafxjzs bingo..that was it. lemmy_lemmy_db_1 has the data. what is the lemmy_postgresql_1 container for? is one for postgresql image and then one for the data?
05:11:57@afxjzs:matrix.orgafxjzs i updated the inventory file to have the credentials/info for the live site and tried to run ansible-playbook lemmy_dev.yml --become -K (which is working for the staging site) but i'm getting an error saying the ports for pictshare and iframely are already allocated. full error output: https://gist.github.com/afxjzs/4f16df1f82049b6d8e5ac240c0b53072
How I got here: this is for a server that was originally configured using lemmy.yml but now i'm trying to build the same site (without overwriting/resetting the data) using lemmy_dev.yml so that i can make changes to the codebase
05:12:07@happydooby:matrix.orgDessalines The lemmy_lemmy_db_1 is the old container, we changed its name a few months ago or so
05:13:02@happydooby:matrix.orgDessalinesYou need to remove that iframely and pictshare one, you should only have one of each running
05:13:25@afxjzs:matrix.orgafxjzsthat's odd.. that's the one with the data in it. i think i cloned the repo on march 13
05:13:31@afxjzs:matrix.orgafxjzs * that's odd.. that's the one with the data in it. i think i cloned the repo on march 13
05:14:35@happydooby:matrix.orgDessalinesYou're trying to do two conflicting installations on one machine, I suggest backing up the volumes folder, doing a DB dump, removing and deleting the containers and volumes, and doing an ansible deploy from scratch. Basically just follow the instructions in that guide above.
05:16:41@afxjzs:matrix.orgafxjzsah...i thought (was hoping) the new one would just overwrite
05:23:40@afxjzs:matrix.orgafxjzsi stopped and then rm'd the containers and re-ran the ansible playbook and it succeeded. data is all there. the only thing that's missing is the thumbnails for the previous links. a just posted a new link and it all worked great, thumbnail, etc...
05:23:51@afxjzs:matrix.orgafxjzsis there a method to rebuild the thumbnails for the posts?
05:25:13@happydooby:matrix.orgDessalinesUnfortunately not, I forget what version I added the thumbnails being written to the DB, but its definitely later than 0.6.20 something
05:25:38@afxjzs:matrix.orgafxjzsbtw.. thanks so much for your help on this. really appreciate it. i'm a rails dev spoiled by heroku. my sysadmin/devops skills are pretty weak, so i appreciate the patience
05:25:52@happydooby:matrix.orgDessalinesHaha no problem.
05:25:54@afxjzs:matrix.orgafxjzsthat's not a huge deal breaker. the site isn't actually launched yet
05:35:10@afxjzs:matrix.orgafxjzswhere were the thumbnails stored beforehand?
05:41:00@afxjzs:matrix.orgafxjzsit also seems like user avatars aren't loading either
05:41:18@happydooby:matrix.orgDessalinesThey weren't stored before. They were fetched on demand.
05:41:55@afxjzs:matrix.orgafxjzsah.. got it. thanks. and i pls ignore the avatar remark. they're loading now. i guess it was just a caching delay
05:42:03@afxjzs:matrix.orgafxjzs * ah.. got it. thanks. and i pls ignore the avatar remark. they're loading now. i guess it was just a caching delay

There are no newer messages yet.

Back to Room List