mirror of
https://github.com/requarks/wiki.git
synced 2026-03-02 22:06:55 -05:00
Import Data from Local Disc says success but does nothing #2558
Labels
No labels
BETA
BETA
accessibility
backlog
bug
can't replicate
contrib-easy
contrib-hard
contrib-medium
deferred
documentation
duplicate
duplicate
editors
enhancement
invalid
localization
migrate
ui
under review
v3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wiki-requarks#2558
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rico161 on GitHub (Feb 4, 2022).
EDIT: SOLVED == The problem is that if you set your local path in the admin panel "storage" section to "/home/user/wiki" for example (which is what the settings recommend even though it's not correct), it actually starts that file path from /var/lib/docker/ sub folders so when my files were in /home/user/wiki they weren't found because it was looking in /var/lib/docker/i/home/user/wiki or some such. This took me forever to figure out because the recommended local path is misleadingly recommended to be "/home/user/wiki" inside the admin panel. Everyone who uses docker - be aware that most of your local files and directories are going to stem from the /var/lib/docker directory and not from the regular root directory.
====
Our old wikijs 2.x version was running SQlite and we upgraded the server and re-installed the latest wiki version, this time with Postgres DB instead. We have the old / repo folder from the previous version with all our pages as .md files, and all our media in /repo/uploads backed up. However, when we try to use the admin panel to import the old data from the local directory nothing is imported. A green "success" notification immediately appears but no pages or data seem to actually be added. There's over 160 pages that we need to import into Postgres, too many to recreate manually.
Is the "storage > local storage > import" prompt supposed to work with .md files or is it impossible to import old .md page files into Postgres?
Running wikijs through docker on Xubuntu.
@rico161 commented on GitHub (Feb 4, 2022):
SOLVED == The problem is that if you set your local path in the admin panel "storage" section to "/home/user/wiki" for example (which is what the settings recommend even though it's not correct), it actually starts that file path from /var/lib/docker/ sub folders so when my files were in /home/user/wiki they weren't found because it was looking in /var/lib/docker/i/home/user/wiki or some such. This took me forever to figure out because the recommended local path is misleadingly recommended to be "/home/user/wiki" inside the admin panel. Everyone who uses docker - be aware that most of your local files and directories are going to stem from the /var/lib/docker directory and not from the regular root directory.
@rico161 commented on GitHub (Feb 4, 2022):
Installation documentation needs serious repair to avoid everyone being confused:
Docker install instructions need to clarify that the actual wiki files installed by docker on the drive are in /var/lib/docker/
Further, it should be clarified in the admin panel and/or documentation that the "local path" in "storage" settings branches from /var/lib/docker/ and not /home/ root.
Docker install instructions need to clarify that wiki pages and media are all stored inside the database now (ive seen a lot of forums with people scouring their hard drives for where the hell their pages are stored, i was doing the same during troubleshooting)
Docker install instructions ran into multiple errors for me (with permissions and finding the postgres db) and i had to fix it with docker-compose, but there's no clear docker-compose instructions aside from a random example config file, and this example file doesn't show you how to use the .db-secret file for the password either like the other docker instructions do.
Hoping this saves others the same headaches I've gone through for the past week trying to get this running!
@akiross commented on GitHub (Feb 8, 2022):
Hi, can you write here the command you used to start the docker container? In
/var/lib/dockerthere are docker local storage files, which usually aren't accessed directly.@rico161 commented on GitHub (Feb 9, 2022):
@akiross I used this command to start the container with docker-compose:
docker-compose -f /home/user/wiki/wiki-docker-compose.yml upAnd this is the contents of my docker-compose file:
@akiross commented on GitHub (Feb 9, 2022):
I think
/home/user/wikiis suggested when installing on the system without using containers. In the docker installation page I don't see any suggestion regarding/home/user/wiki.I'm using containers as well (sqlite instead of postgres) and I had no issues. Also, note that in the docker image the path of the wiki is in
/wiki(that can be seen in the documentation in theAlternative: Mount the config filesection):In this case, I specify that
/wjsis mounted and contains the database file. If I specify e.g./wjs/local_storageas the local storage path, it works as I expect and I find the data in/home/my-user/wikijs-mount/local_storage.I hope this helps
@rico161 commented on GitHub (Feb 9, 2022):
/home/user/wikiis not suggested by the documentation for the local storage path, i meant that it is suggested in the admin panel inside of wiki.js Local Storage settings (it is displayed as the example path under the field where you enter the path for local storage). The problem is that/home/should be starting from root when i enter it as my local storage path, but in my installationhome/is stemming from the root of/var/lib/docker/...instead of the true system root.One difference i notice in my docker-compose file (compared to the command you are running) is that i didn't specify "DB_FILEPATH" (but i used the example docker-compose file in documentation). So i'm not sure if that's why the path isn't starting from root or not, but if that's the reason why then the example docker file in documentation should be corrected to include that. Documentation specifically says that it's for SQLite only though and not for Postgres, so it shouldn't be a problem for my setup.
I'm not sure how to add the other line
-v"/home/my-user/wikijs-mount:/wjs:Z" \into my docker compose file properly but if something like that is required then it should definitely be in the example file.Originally i had tried running the regular docker commands from documentation, which were similar to what you posted above, but that didn't work because of errors connecting to Postgres, which is why i had to switch to docker-compose which fixed that issue.
@akiross commented on GitHub (Feb 10, 2022):
Well, not really, it shouldn't: you're running in a container, so there is no mapping with the filesystem unless you specify it (that's what the
-v"/home/my-user/wikijs-mount:/wjs:Z"flag does). The fact that you're seeing the files in/var/lib/docker/...is just because your docker storage driver places the container there - but this is not mandatory, it might change between different computers and installations.I think the docker documentation currently on-line is decent, while it doesn't explain how to set-up wikijs with postgres containers. One option is to create a network and attach two containers to it. Here's an untested example to give you a rough idea:
This is similar to what docker-compose is doing: it creates a network and places two containers in it. But I see no particular reason to do this manually when you're using compose already.
To mount the
/wjsdirectory from the container on your filesystem, similar to what I did, you can edit your compose like so:If you use
/wjs/foobar/in your local storage configuration, you should be able to see thefoobardirectory in/home/my-user/wikijs-mount/foobar.Hope it helps
@rico161 commented on GitHub (Feb 11, 2022):
Thanks! That's super helpful, I don't know much about docker or docker-compose so your docker-compose example is perfect, it seems like that's what's missing from the documentation example.
I'll try modifying my docker-compose file with these new settings, i was going to edit it to change the port anyways. Do you know by chance if when i run
docker-compose downand change my file, then rundocker-compose upagain with my new .yml file if it will wipe any of my data/settings inside the wiki or keep my wiki intact as it was? Worried about losing Postgres data by re-making the containers, i'm not sure if that would happen or not.