The physical location of the files in your web space is independent from the connection to the database so you can move the files to another folder and Joomla will usually work just fine.
It's possible that the development and live website point to the same database but this would not be the best way to create a new development website unless they use different prefixes. You can see which database Joomla is connecting to in Global Configuration > Server
or in the configuration.php
file.
You will also need to update the paths to the tmp
and logs
folders in Global Configuration.
You may need to update the $live_site
parameter in the configuration.php
file if it has been specified.
You may also need to update the .htaccess
file in case any absolute or relative paths are specified in there.
When I make a development website live, I usually copy all the files and folders in the root of the website (except the /dev
folder) to /old
and then move everything from /dev
to the root folder. You then have the old website available if needed for a while.