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

Database import from .sql file failes, but process keeps running in the background #544

Open
countfak opened this issue Sep 17, 2024 · 4 comments

Comments

@countfak
Copy link

Quick summary

Hi, I wanted to share my experience with database import from a .sql file.
I tried multiple times with different database sizes, last one was around 40MB.
The import goes on for a while, then the import failed message appears. But the import process is still running in the background.

Steps to reproduce

Drop a large .sql file with the built-in import functionality of an existing site and start the import. It will likely fail, open up the Activity Monitor app and find the Studio process at the top with high CPU usage, meaning that the import is still running in the background. After a while the CPU usage of the process drops, and the import is actually finished.

What you expected to happen

I wasn't expecting to get the error message if the import process was still running in the background.

What actually happened

Got import failed message even if the import was still running, see above.

Impact

One

Available workarounds?

No but the app is still usable

Platform

Mac Silicon

Logs or notes

No response

@countfak countfak added [Type] Bug Something isn't working Needs triage Ticket needs to be triaged labels Sep 17, 2024
@wojtekn
Copy link
Contributor

wojtekn commented Sep 17, 2024

Thanks for reporting the issue @countfak . We will check it.

@Robertght
Copy link

Marking this as Triaged but let me know @wojtekn or @countfak if you have a large DB file I could use to test this.

@Robertght Robertght added Triaged and removed Needs triage Ticket needs to be triaged labels Oct 4, 2024
@countfak
Copy link
Author

Just wanted to follow up on this and share my latest successful attempt.

What I tried and didn't work out:

  • import sql file via the built-in import functionality: this causes the issue explained above, not even sure the import finishes and is done correctly, it just takes a lot of time
  • import using all in one wp migration plugin with a .wpress file: this fails with error 400 bad request in the javascript console
  • import via command line with wp cli sqlite (https://github.com/Automattic/wp-cli-sqlite-command): this takes a lot of time too, I didn't wait for the import to finish, probably same as above

What worked for me was:

  • create new site in Studio
  • export sql file from the website that I want to import into Studio
  • replace the url in the database if needed
  • convert sql to sqlite with this: https://github.com/mysql2sqlite/mysql2sqlite
  • move the new database to /wp-content/database/.ht.sqlite (replace existing)

Please note that this only applies in case of large databases with a lot of entries (for reference mine was around 40MB), the built-in import works fine if I try with a smaller database.

@wojtekn
Copy link
Contributor

wojtekn commented Oct 29, 2024

Thanks for sharing your workaround @countfak, it's useful. We will check how we can improve Studio Importer to support databases of any size.

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

No branches or pull requests

3 participants