Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.55k stars 849 forks source link

Newbie question... But how do i transfer or put up the website in the right correct way? #2700

Closed digitalnb closed 4 months ago

digitalnb commented 4 months ago

Hey i'm quite new with this. Thanks for the brilliant software! Seems complicated to create. Lots going on, put together nicely. But what if i design a website offline and use links to stuff as site.test, etc, and wanna transfer it to the real domain name? Do i need to change that also when uploading it, plus other files? How does that work again?

Might just need to upload it, and it works.. maybe not if i have linked some stuff to the .test on the site, i might just need to update those right? On the real site, "realsitename.com" when i try that later on. Also, what's a good open source software to deploy a website in debian? Thanks!

welcome[bot] commented 4 months ago

Thanks for opening your first issue here! Be sure to follow the issue template and include your OS/Vagrant/VVV versions! Don't forget you can get support in the VVV slack at https://varyingvagrantvagrants.org/docs/en-US/slack/

VVV
VVV Slack Workspace
Join the VVV Slack Workspace
tomjn commented 4 months ago

Honestly, just pretend you paid a host named VVV and the problem becomes a general one that applies to anywhere.

E.g. if you created a site on GoDaddy and need to migrate it to Siteground with a new URL what would be the difference? It's all the same tools and software.

Generally you'd want to export the sites data, put it on the host, search replace the name. Plugins might do it another way, you might even choose to keep identical hosts locally so they all use the same URLs ( at the cost of not being able to access production while using VVV due to the hosts file change ).

You'll likely see thousands of contradicting opinions on how to migrate a site, that the host you're migrating from is on the desk in front of you shouldn't change that much.

The parts that are VVV specific though that might help:

Also, what's a good open source software to deploy a website in debian?

Honestly I couldn't say, there's no correct answer, and it needn't even be Debian specific as a lot of the same tools work on Windows/MacOS/etc

digitalnb commented 4 months ago

ok,, thanks. Should i have used the original site name when i build stuff, to avoid migration issues? I'm not sure if that's possible offline? How then... I will have to fix the migrate issues when i try that later on... But for future work. Should i have the name of the real site address, but offline then? Or is vvv.test fine also? How do you design and working with addresses? And most... Also, i will find some good software later on when i put it up... But feels like i should have used the original name, in some host file.. Then i would been able to just restore the site with updraft plugin, and it's all working. If i now create a wordpress site and upload the updraft plugins, i'm not sure how that will look! Experiments for now... Hope it works though! And i can change some stuff in the URL.. hmm. Hope it's not to hard, because it's pretty cool designed in my opinion, and like flow, motions and stuff i learnt. just want an easy migration later on. I should probably needed to change some host file, and create offline for an easier time when i put it online in a few weeks. It's a great tool for offlline use, i just need to learn it better probably with migration, or URL renaming when i start my next project, if i already have the domain name. It's lot to learn in both web development and setting up a site, or migrating, etc... But i will get there eventually.. Will be kinda interesting to see how it goes. Hmm.. Hoping for the best. I should have asked here before i started to design though..

But for the next project. I wanna name it to the real domain name in some host file, right? Designing in vvv.test is not recommended? Or is it no big deal with the migration and kinda easy?

Might have been a big DOH on this one.. I'm kinda new in both linux, web development and everything. Just learning. Seems like an awesome project for designing offline though, and the best i have found! I just need to learn howto use it more when it comes to addresses and designing, deploying websites in the best ways really.. I reckon i did not read through everything before i started designing... The real website URL would been the best with offline designing of-course. But i will probably manage to migrate it later on, and it's help here also, so that's cool. thanks Also pretty awesome that i have designed and created my first website offline! :) vvv vagrant is dope! Just gotta gather some info on how to deploy it later on. But i will probably use updraft plugin, and then maybe need to change a few files.. maybe not.. Time will tell..

tomjn commented 4 months ago

I haven’t used the same domain in years, changing the address shouldn’t be a problem and there’s lots of ways to do it.

I know it would have been nice if I turned around and said there was a specific VVV way to do it but there isn’t, you’d be in the exact same situation if you were asked to replace production with the contents of a staging environment, or to migrate a site to a new host+domain

digitalnb commented 4 months ago

Ok, well i don't know how individuals fix with staging environment, or migrates a site to a new host+domain, yet.... But it can't be that hard. I can also ask for some support here when i try it in a few weeks. But yeah, lots of ways seems good. But i will probably try the updraft plugin, then get back here.. Thanks

tomjn commented 4 months ago

They all involve exporting the DB, changing the URL using a tool, then putting that DB on production. Note that if you want to keep the production DB and do partial updates then things get a lot more complicated and the number of options for how to do it reduces significantly, very few people have an answer for that and it's very context dependent.

It's also dependent a lot on the skill level and skill set of the person doing it. E.g. for some people they download and install a plugin at both ends and connect them and the plugin does all the work. For other people WP CLI is the answer. Other do it all manually with separate tools

If you're comfortable in the command line and want to use WP CLI, take a look at https://developer.wordpress.org/cli/commands/search-replace/, and avoid doing a search replace SQL statement as it'll corrupt any values if your new URL has a different length

WordPress Developer Resources
wp search-replace – WP-CLI Command | Developer.WordPress.org
Searches/replaces strings in the database.
tomjn commented 4 months ago

From the VVV docs:

digitalnb commented 4 months ago

Thanks, well i'm hoping updraft plugins fixes much of this on the fly.. https://wordpress.org/plugins/updraftplus/

That's what i will start with. Then i can get back here.. I have paid for the premium and it seems smart.. It even says migration on the link so yeah. Hoping for the best. ;) I might design a bit today also actually... loving that tool so far! But yeah, i think that will work later on actually. I might need to change a few lines of url code i did manually, on the site itself though.

WordPress.org
UpdraftPlus: WordPress Backup & Migration Plugin
Backup, restoration and migration - world's most popular backup tool. Backup to the cloud - schedule backups or backup manually.
tomjn commented 4 months ago

From a quick look that might do the job, I'm going to close this out but feel free to reopen if there's anything on the VVV side