When you copy projects to web-server, you can locate common files (database file, master page) in separate directory. You should edit paths to them in generated files.
f.e., if you copy database file to directory abc\App_Data - you should edit connectionString in web.config files.
For master page - you should edit path in Page directory - f.e., MasterPageFile="/Default.master".
You can allocate common files with code in abc/App_Code directory