0

I have migrated my WP site from a shared host to my own dedicated host and some weird issues are occurring. When I create a new post and press Publish, the page reloads and says the post has been published, however the url or the post given is just one with an ID, like how they give you preview links.

When I click on the post it just shows a 404 page, if I go back to my posts and look for the post... it doesn't exist.

I suspect its something to do with permissions either on the disk or the DB... can anyone help me troubleshoot?

Edit: I do have the Total Cache plugin, but I have cleared the cache completely after creating the post and it is still not there. I don't think this is the issue though, as at the very least the post should appear in my wp-admin (which it isn't)

Second Edit: Interestingly when I turned on WP_DEBUG in wp-config.php I noticed the following error when creating a post:

WordPress database error: [The user specified as a definer ('user1'@'localhost') does not exist]
UPDATE `wp_posts` SET `post_author` = 1, `post_date` = '2018-04-01 21:32:12', `post_date_gmt` = '2018-04-01 20:32:12', `post_content` = 'something goes here', `post_content_filtered` = '', `post_title` = 'Test Post', `post_excerpt` = '', `post_status` = 'publish', `post_type` = 'post', `comment_status` = 'open', `ping_status` = 'closed', `post_password` = '', `post_name` = 'test-post', `to_ping` = '', `pinged` = '', `post_modified` = '2018-04-01 21:32:12', `post_modified_gmt` = '2018-04-01 20:32:12', `post_parent` = 0, `menu_order` = 0, `post_mime_type` = '', `guid` = '' WHERE `ID` = 49821

The thing is, this isnt the username or host defined in my wp-config.php file, so I'm not sure why this error is occurring. If I update the existing define('DB_USER', 'dd_wp_user'); in my wp-config.php file to something non-existant though the page shows a DB error so the config is being read.

InvalidSyntax
  • 9,131
  • 20
  • 80
  • 127
  • first of all, how did you migrate your website? do you changed your website url from old to new? did you change all records with old website domain to new one? did you get any error in the error log? – Samvel Aleqsanyan Apr 01 '18 at 17:41
  • The domain hasn’t changed, it’s just the server that has. – InvalidSyntax Apr 01 '18 at 17:57
  • I see. check `.htaccess` file. is it there? resave the permalinks structure – Samvel Aleqsanyan Apr 01 '18 at 17:58
  • Yep the file is there, and I’ve resaved the permalinks. I’m not sure it’s an issue with this however, as the post isn’t actually saved at all. I can’t see it in my Posts page within wp-admin – InvalidSyntax Apr 01 '18 at 18:04
  • do you enabled [debug mode](https://stackoverflow.com/a/48905999/8053001)? any errors? – Samvel Aleqsanyan Apr 01 '18 at 18:05
  • @SamvelAleqsanyan Ok this is interesting, I've turned it on and get this error when creating posts. `WordPress database error: [The user specified as a definer ('user1'@'localhost') does not exist]`, the weird thing is, this is not the username or the host defined in my wp-config.php. – InvalidSyntax Apr 01 '18 at 18:40
  • I've done a search for that username using `grep -rnw public_html -e 'user1'` however all I can see is references to it in the error log, not in the code itself. – InvalidSyntax Apr 01 '18 at 18:46
  • check one more time `wp-config.php` file. what is your `DB_USER` constant? – Samvel Aleqsanyan Apr 01 '18 at 18:58
  • but, if you can login into website, the error can't occure because of `DB_USER constant`. any errors in the server logs? – Samvel Aleqsanyan Apr 01 '18 at 19:16
  • also, try solutions from here: https://stackoverflow.com/q/10169960/8053001 – Samvel Aleqsanyan Apr 01 '18 at 19:18
  • @SamvelAleqsanyan the user in the error message doesn't exist and shouldnt, the user stated in the `DB_USER` is `dd_wp_user`. This `IS` working as I wouldn't be able to login to the backend without having this working. The issue is only when creating/updating a post. – InvalidSyntax Apr 01 '18 at 20:11
  • yes, it's so. did you try the solutions from [here](https://stackoverflow.com/q/10169960/8053001)? – Samvel Aleqsanyan Apr 01 '18 at 21:08
  • @SamvelAleqsanyan The solution in your comment is to merely make that user, I've just stated this user isnt the correct one. – InvalidSyntax Apr 01 '18 at 21:17
  • yes, but you migrated website from other server. maybe, there were some indexed values under `user1` login – Samvel Aleqsanyan Apr 01 '18 at 21:19
  • 1
    Sorry I didn't see the highest rated answer in that link first. Its resolution didnt resolve it, however I reimported the dumb without the definer line and its working correctly again. – InvalidSyntax Apr 02 '18 at 00:07

0 Answers0