Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
P

paul.toone

@paul.toone
About
Posts
22
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Custom Apps
    P paul.toone

    Just an update, I was able to get NextCloud converted over. Dumping the existing mysql database with PostgreSQL compatibility did not work. I'm next going to test out user mapping via cloudron LDAP and once that is complete I'll update all my notes into a more readable format. But the process was essentially this:

    • Have a fresh NextCloud App running on Cloudron and immediately enter recovery mode

    • Bring up a temporary machine running PostgreSQL

    • Build pgloader on the temporary PostgreSQL Server

      • sudo apt install sbcl unzip libsqlite3-dev gawk curl make freetds-dev libzip-dev
      • curl -fsSLO https://github.com/dimitri/pgloader/archive/v3.6.2.tar.gz
      • tar xvf v3.6.2.tar.gz
      • cd pgloader-3.6.2/
      • make pgloader
      • sudo mv ./build/bin/pgloader /usr/local/bin/
    • Create a postgres user

      • sudo -u postgres createuser --interactive -P
      • <NewPostgresUser>(username)
      • Set the password for this role <NewPostgresPassword>
      • Make the user a super user
    • Create an empty postgres DB

      • sudo -u postgres createdb <emptyDBName>
    • Create a user on the MySQLDB and give it all privileges to the NextCloud DB

      • mysql> CREATE USER ‘<someMySQLUserName>’@’<postgersServerIP’ IDENTIFIED BY ‘<SomeMySQLUserPassword>’
      • mysql> GRANT ALL ON <nextcloudDB>.* to ‘<someMySQLUserName>’@’<postgresServerIP>’;
      • mysql> flush privileges;
    • From the PostgreSQL Server ran pgloader

      • pgloader mysql://<someMySQLUserName>:<SomeMySQLUserPassword>@mysql_server_ip/<nextcloudDB> postgresql://<NewPostgresUser>:<NewPostgresPassword>@localhost/<emptyDBName>
    • Dump the PostgreSQL Database

      • pg_dump <emptyDBName> > pgdump.sql
    • Get CLOUDRON_POSTGRESQL_USERNAME from the app container running the NextCloud APP.

    • sed the .sql file and replace the schema with public

    • sed the .sql file and replace the <table owners> with CLOUDRON_POSTGRESQL_USERNAME

    • Open a web terminal to the NextCloud App that is in recovery mode and upload the .sql file via the Upload to /tmp button

    • Run the following commands grabbed from https://docs.cloudron.io/guides/import-postgresql/

      • sed -e 's/CREATE EXTENSION/-- CREATE EXTENSION/g' -e 's/COMMENT ON EXTENSION/-- COMMENT ON EXTENSION/g' /tmp/pgdump.sql > /tmp/pgdump_mod.sql
      • PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public"
      • PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} --set ON_ERROR_STOP=on --file=/tmp/pgdump_mod.sql
    • Move just the data from the old NextCloud server into the data directory of the NextCloud App on Cloudron. This is found in the app’s config page | Storage Section, should be something like:
      /home/yellowtent/appsdata/<containerHash>/data

    • Bring the container out of recovery and boot up

    Again, I'll update these notes if/when I try again and get cloudron's LDAP to map to the users in the database but for now, maybe these steps will help someone looking to convert and existing installation over to a Cloudron app.

    Support import migration

  • gitlab-ee question
    P paul.toone

    My attempts failed, unfortunately. However, I am happy to use gitlab's export groups and projects and rebuild our new gitlab server that way. We are fine with this process but cloudron seems to be great for starting new services from a fresh state or if you're transferring existing projects with the same setup (using the same database, for example) I have some questions regarding that but I'll open a new thread on that. Thank you all for your suggestions.

    GitLab

  • Custom Apps
    P paul.toone

    @brutalbirdie fantastic advice. I'll give it a shot and see how it goes. Thanks for your help

    Support import migration

  • Custom Apps
    P paul.toone

    @brutalbirdie Yeah, I'm concerned about this as well. I'll definitely keep notes on the progress

    Support import migration

  • Custom Apps
    P paul.toone

    One other note, the .sql file originally failed to upload due to the dump having the following line:

    Create SCHEMA public;
    

    I commented that out and the import ran fine. I'm guessing there is a command to dump the Postgres DB without a create statement but someone smarter than me probably knows it. I haven't used Postgres a day in my life until yesterday so I'm still getting to know it. I have only used MySQL, Maria and MS SQL and all of those have an option to dump without the create statement, but I figured it was just easier to comment that line out of the SQL file instead of looking up the command and doing a new dump.

    Support import migration
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search