# Updating Development from .dev to .test TLD

**URL:** https://discourse.roots.io/t/updating-development-from-dev-to-test-tld/12218
**Category:** trellis
**Created:** 2018-04-15T23:09:12Z
**Posts:** 7

## Post 1 by @Simeon — 2018-04-15T23:09:12Z

If this has already been covered elsewhere I haven’t seen it. And while it’s probably fairly obvious this might be useful to have written up … for someone.

If you’re still using the .dev TLD for development you need to stop. And if your old sites still use it you need to update them. Especially in instances where you’re _not_ using self-signed certificates for development.

1. `vagrant up` your development environment
2. `vagrant ssh` into the box
3. Navigate to the current folder `cd /srv/www/example.com/current`
4. Use WP-CLI to take a backup `wp db export before-tld-change.sql`
5. And use it to do the search/replace of the DB `wp search-replace //example.dev //example.test` (add `--dry-run` if you want to test it first)
6. Exit the SSH session
7. Edit `trellis/group_vars/development/wordpress_sites.yml` to use your new `.test` TLD
8. Run `vagrant provision` to re-build your development box. This **will not** effect your existing database or uploads.
9. Run `vagrant up` again to rewrite your `/etc/hosts/` with the new domain

Done!

---

## Post 2 by @swalkinshaw — 2018-04-16T03:39:04Z

Thanks for this :heart:

---

## Post 3 by @fullyint — 2018-04-16T13:00:34Z

Thanks @Simeon

Given that Trellis Vagrant VMs typically use the [Vagrant Host Manager](https://github.com/devopsgroup-io/vagrant-hostmanager#usage) plugin, people may want to also run `vagrant hostmanager` to update their `/etc/hosts`. Then the local browser will serve the revised domain.

---

## Post 4 by @Simeon — 2018-04-16T19:59:43Z

I thought the `vagrant provision` would cover that step, or `vagrant up`?

---

## Post 5 by @fullyint — 2018-04-16T21:06:49Z

I brought it up because I remembered being surprised one time that `vagrant reload` didn’t refresh the hosts file (like it refreshes the sync dirs; [discussion](https://github.com/devopsgroup-io/vagrant-hostmanager/pull/130)).

In my tests just now, hosts are not updated by `vagrant reload` nor by `vagrant provision`. However, hosts are refreshed by `vagrant up`. I wouldn’t have thought to run `vagrant up` for a VM that is already running.

So, I guess a `vagrant up` or `vagrant hostmanager` would do the job for updating hosts.

Again, thanks for laying out these useful steps. :slightly_smiling_face:

---

## Post 6 by @Simeon — 2018-04-23T00:13:58Z

You’re so right … just came back to follow my own guide here and I should’ve included to run `vagrant up` again at the end. Have updated the OP :smiley:

---

## Post 7 by @masoninthesis — 2018-04-26T06:18:03Z

I needed to do this on one of my sites, and was too afraid to ask, too lazy to research. So thanks man!
