How to push to a clean staging?

How do you push a new site developed locally to Kinsta?
I can only push to a staging site, but doing that requires the staging site to pre exist. This means it is cluttered up with all my current sites stuff - esp all the plugins. So when the push happens I now have a hybrid staging site full of the old stuff as well as the new.

What I really want is to be able to push to a brand new clean and empty staging site. Is this possible?

Cheers
Alan

1 Like

Hi @alanj, thanks for reaching out! yes it’s possible. You can either completely delete the staging environment then recreate it, or you can contact our Live Support team and ask them to “reset” your current Staging environment.

Thanks, I’ll try support. But not sure what a “reset” really is, won’t they just recreate staging rather than provide a blank canvas to push to?

Deleting and recreating staging doesn’t help, as the new staging pulls the current live. In this case I have built a brand new site on DevKinsta and want to replace the live site with it. Hence the need for a fresh clean environment.
I’d hoped that the push would overwrite the entire environment but it doesn’t seem to, but rather merges things.

Cheers
Alan

Got it, so in that case all you really need is for the ~/public directory to be deleted/cleared out and maybe the database to be dropped/recreated.

You can just ask our support team to “Reinstall WordPress,” which will give you brand new/fresh WP install. I believe that will only come with the default plugins like “Hello Dolly” but you can then ask for ~/public to be cleared as well in order to get a 1:1 transfer from Local to Staging.

I’m going to bring this up with our devs, though because I agree that we should at least have the option to completely overwrite instead of always merging.

Excellent thanks.

Yes I could do it myself via sftp but it would be nice for it to be a one click operation.
Actually the same issue applies moving from Staging to Live on Kinsta. Looks like the push there is the same format.
Cheers
Alan

1 Like

So pushing Staging to Live should be overwriting things in MyKinsta. If you’re able to reproduce this issue there please reach out to our Live Support so they can look into what’s going on.

I tested my own site/Staging and it wasn’t merging files/plugins that way. Either way, chat support would be able to look into it closer/make sure the Staging Push process is working as intended.

Ok. I was just going from reading. Its says it will push “changes” which to me implies a merge rather than an overwrite. But I haven’t tested it for my live site yet.
Thanks again
Alan

1 Like

FYI.
Kinsta support had me create a new staging site. They then ran some script against it to reset it to a blank site. ( Thanks Shane ) I was then able to push from DevKinsta to Staging ok and I was able to push from Staging to Live.
So the process works. Just a small bit of automation perhaps to make this one click direct from DK?
Cheers
Alan

1 Like

Thanks for the update @alanj, our devs are working on a future update that should resolve this. Instead of merging files we may start deleting the “destination” files so you don’t wind up with mixed files/folders.

I can’t think of a situation where merging the files and folders would be ideal so I think our Devs fixing that behavior would address the main issue.

Thanks again for bringing this to our attention!