I created a custom function (using Code Snippets plugin) that gives me a contenteditable div on the dashboard where I can add notes about the site.
But, after importing from a LocalWP export, the entire snippet itself has vanished. This isn’t the first time either. I tried adding similar function to my functions.php file directly on a different local site, and although the function wasn’t missing after export, the custom database option field was.
My simple analysis is that either the issue is happening during export or import – since the both processes are black-box, I can’t tell which.
Finally, the standard “deactivate this or that, plugins, themes, etc.” doesn’t seem to apply in this case.
Please advise what could be causing this. I’ve attached the code snippet as a .txt file in a zip (to avoid being filtered mistakenly by antimalware) ehd-snippet__notes-dashboard-widget.zip (1.4 KB)
Thank you,
Eric
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
Install local
Create test site
Add all the same plugins and theme/child theme (you can probably get that info from the logs, right?)
Install the Code Snippets plugin
Add the attached PHP code snippet
Type some test text in the “Custom Editable Widget” dashboard widet and click save btn
Refresh the page and observe that the database option was successfully saved, otherwise the data would have disappeared
Export the site (with or without zip exclusions doesn’t seem to matter)
Import the site as a new/different site into LocalWP
Login and observe that the widget is missing from dashboard
Check the “Code Snippets” plugin page and observe that the snippet is completely gone
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
Hello? @Nick-B@austinwendt@sambrockway This is still happening. Now more than just an annoyance, (a probably-related issue), I discovered today that I’m unable to either export or import without file loss / data loss.
I exported a site that is currently working in Local to a zip file, then imported into Local as a new site to verify nothing was missing or broken. To my chagrin, I found that several (but not all) plugins were missing as well as the astra theme and my child theme. Not only that, but the 3 default WordPress themes were there instead.
Apologies I did review your original post and share it with the Local team but we just haven’t been able to dig in and do any extensive testing yet regarding that specific issue. That said we don’t really have any bugs around export/import. Doing simple tests with this function on my end throughout today and all works fine.
The screenshot you shared of the plugins all missing and throwing an error I did see recently with someone else I was helping with an import. The solution was to remove various core files, backup files, etc that they had in their zip before trying to import it into Local again. I can appreciate that this export was created in Local, so that might be a bit on us to look into ways to ensure exports created in Local are easier to reimport. I noticed however that you have an updraft plugin for example. So is there a chance in your site example above that you have extra site backups, DB backups or core files saved within the zip you’re trying to reimport?
No site backups or oversized databases - I’ve cloned this site multiple times and everything has been fine. But, just the weirdness I originally reported where my “Code Snippets” plugin was installed, but the actual snippet was missing. As if Local import process has some kind of aggressive anti-malware or something like it that somehow filtered my snippet out – is that possible?
Heres a screen of the wp-content/ subfolders. Whenever I import the exported ZIP backup from our live WPEngine site, I always have to remove everything in wp-content that isn’t standard. The second thing I do I disable and delete the UpdraftPlus plugin since I don’t need it on Local sites. I don’t see the “updraft” folder in here at all, so I don’t think that’s the issue. It was a good suggestion though.
As far as anything else out of the ordinary about our site, our site is a dynamic web application that was migrated from a custom codebase to WordPress running Elementor last year. A legacy “images” folder with about 1 GB of files is in the root folder. But, that’s not been a problem.
In fact, Nick, I remember you were helping me try to troubleshoot data loss issues a year or so ago caused by LocalWP breaking changes in an update. I never did get that data back, but I’ve wanted to tell you Local has been working great for me most of this year until now, and I don’t have any problem recommending it people. I’ve created probably 10 different backups in the past 3 months of PROD or STAGING and then cloned those multiple times and had been very happy with Local.
I don’t have any more time to deal with this tonight, but I will look forward to reviewing any suggestions you might have tomorrow morning! I’ll test out the manual import tomorrow and see if I have success, and report back.
I am unable to reproduce this issue, both by following the steps you provided and in testing with other various sites of mine (export from Local, reimport, all of my plugins are there, images load, etc.). But I believe you that it is happening to you!
For example, I built the site as you described, called Code Snippets. I exported it from Local, and reimported it as Code Snippets Reimport. You can see my snippet is still here and the content I saved is with it:
It could be some form of database corruption, at least in the Code Snippets case - assuming everything is saved in the database table, it not being present on reimport would mean it didn’t get included on the export or the import of the database failed. There isn’t any “anti-malware” process that would be stripping things out during import, AFAIK.
The import/export functionality isn’t necessarily a black box - the .zip file can be opened to see what is in it. If you unzip the export you took, can you check a few things:
Are your plugins still there?
If you open the .sql file, can you find the database tables for Code Snippets plugin and see if your new snippet was saved?
I’d also be curious to see if any errors popped up in your logs before/during/after the import and export. I didn’t see those above (sorry if I missed them) - could you share those?
If easier, I’d be happy to take a look at the .zip file too and see if I can repro with the same file you’re using if that is something you’re comfortable with. You can either DM it to me or reach out and I can give you my email.
Based on this research and detail I provided in this post, including users with relate, it looks to me like some update between August and October caused the zip import feature to break for a subset of users. Please advise the dev team to carefully look at any comments they get on this issue. If it seems random or intermittent, they probably won’t be able to troubleshoot by replicating, but will need to deduce solutions from the clues given by users.
Hey @CodeSlayer2010! I’ve merged your bug post into this one as we aren’t finding any commonality with the other posts you’ve referenced or been able to replicate. That said, we’re absolutely happy to help you get to the bottom of this as best we can. Please see Austin’s comment above and let us know when you’re able to take a look and provide some follow up information!
Hey @austinwendt - thanks for your reply! I checked the ZIP file and discovered a few things:
Are your plugins still there?
YES! So, that tells me the export is working and it is the Import that is failing.
If you open the .sql file, can you find the database tables for Code Snippets plugin and see if your new snippet was saved?
This is interesting. There are 3 SQL files in the sql/ folder. The smallest is the database from before the site was converted to WordPress. I’m not sure the difference between the local.sql and the mysql.sql – they both appear to be created by LocalWP.
Another interesting tidbit:local.sql is 34MB and mysql.sql is 40MB – not sure if that makes a difference, but when I tried to load local.sql in MySQL workbench it hung, then when I tried to load it with VSCode, an alert popped up stating this was a “large database”.
I can provide logs, but I’m concerned about this being a public forum and my logs containing private info.
Hey there! I’m glad the manual import worked - was this just un-zipping the .zip you were trying to import into Local? Just confirming all the files were the same, etc.
Yes, it is possible - that is great we’ve narrowed it down that far. Definitely understand about not wanting to share logs publicly; check your DMs here on the forums (under your avatar, in Profile) and you can share them privately.