Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A version of localtos3.php adapted for PostgreSQL made with the help of ChatGPT #16

Open
DavidCamejo opened this issue Jul 3, 2024 · 4 comments

Comments

@DavidCamejo
Copy link

DavidCamejo commented Jul 3, 2024

This is a raw version that has not been reviewed or corrected. The idea is that together we can create a fully functional final version.
I'm new to Github. This is the easiest way to share the file:
https://cloud.brasdrive.com.br/s/f3cReWoRGAxaDMH

Explanation of the Adaptations Made
Connection to PostgreSQL:

All database connections and queries were changed from MySQL to PostgreSQL using pg_connect, pg_query, and related functions.
Backup and Restore Commands:

The backup and restore commands were changed to use pg_dump and psql instead of mysqldump and mysql.
SQL Queries:

The SQL queries were adapted to use PostgreSQL syntax, including double quotes for identifiers and specific functions like EXTRACT(EPOCH FROM ...).
Execution Options:

The dry-run, update-db, and delete-local options were kept as they were in the original script.
S3 Compatibility:

The configuration and use of AWS S3 for file synchronization were maintained.
This script should be executed in the Docker environment of Nextcloud to ensure that all dependencies and specific configurations are available. Be sure to make a full backup before running it in your production environment.

@szelga
Copy link

szelga commented Aug 18, 2024

I've made a version utilizing PDO, so theoretically it could be adapted to a "universal" script. still needs some work on SQL scripts to see, if there are some flavor-independent options (mostly considering time functions in MySQL and PostgreSQL).

@szelga
Copy link

szelga commented Aug 21, 2024

here it is:

localtos3_pg.php.txt

tested on a real (albeit small) NextCloud docker installation.

@szelga
Copy link

szelga commented Aug 21, 2024

had issues with OnlyOffice previews after that, had to turn them off. not sure if this is due to migration or wonky OnlyOffice integration settings.

@mrAceT
Copy link
Owner

mrAceT commented Aug 21, 2024

When I find the time I'll take a look at your work, thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants