Erased 200 files from my server

I do not blame this error on Wappler. I did it. I had just learned how to connect to my server and thought i was uploading a test file. Boy was I wrong. I know, RTFM. Now I fall on the tender mercies of the community. When i call my server, they had forgotten to implement my daily backups so at least this led me to finding out before something disastrous happened.

Thought i was uploading a file and erased 200 from my server. Index.html was replaced with index.php. Restored the .html file so site is accessible again, but not sure what’s missing.

Now, is there anyway to get a log of the deleted files so i can restore them?

Thank you very much.

To be honest I do not think you deleted your index.html file at all.
Pretend your website domain is, example.com
If your server had only an index.html file in the public_html root directory and you browsed to example.com it would display your index.html file.
If you then kept your index.html file untouched and saved another file as index.php also inside the public_html root directory, it would not replace your index.html file, however if you pointed your browser to example.com it would display the index.php file as priority 1.

In other words, your server says something like this
if you can not find index.php file, then look for index.html and display it
if you do find index.php file, then dont bother looking for index.html, just display index.php

Try this, hopefully you never broke it worse by trying to fix it
go to your website domain of example.com/index.php and then try example.com/index.html you should see 2 different files which will confirm this.

You can check which files are on your server.

Open your files panel and change from Local to Target. This will show you the files on your server.

Thanks for the help. But, yeah, the index.html was gone and index.php was on server. I uploaded the old index.php and that problem was fixed. What i fell i need is some kind of log file to know what to replace. There was one when Wappler was open which is where i got the # 200. It listed the files and directories it deleted and the ones it skipped. I was freaking out about that time and just shut it down. If i hadn’t i would have the log file and all would be well.

Do you have a local backup of the correct files on your computer?

Thank you for the response. I did that and also with my ftp programs. There are several files missing. I just need a log file to figure out which ones before just making a wholesale upload of my local files.

If you hosting provider is using the normal cPanel, you could get a log file by clicking on Raw Access under Metrics, inside there you should find 3 files for your domain, one of them says (ftp) at the end, click that which should download a compressed .gz file. Download it, decompress it, and view it insite a text editor, it should have a list and the date and time on the left of each.

Beautiful! I will find them there. BTW I thought that by clicking “Publish” it would only publish the folder i was working on. What is the proper way to publish projects or files?

It depends on your situation, but Wappler has an FTP sync system to ensure your newest files are always on the server, even just hitting save to your file while your target is set to your ftp server is going to try and find all the files that require updating.

Normally this would not be an issue, so I assume you have an existing website already live and online that you do not want to overwrite or something with newer files until everything is finalized or something. Could you confirm that for me so I have a better understanding.

Please make sure you get that log file as a matter of urgency as I think it only stores a certain number of entries and resets daily, so the sooner the better

Thank you. You are correct. I have a website that has about 1,000 files and has been around since 1996.

Got it. It had not been updated since 5 PM which is about when i made my error.

Ok, is there any chance I could have a look at that website to check some of its structure to advise easier

Yes I do. Just did not want to upload willy-nilly as there are various versions of pages that never made the cut to go public. Mostly .html, some Bootstrap and a few .php.

It is always a tricky issue and something I still deal with as an issue too. Having a live site, you are trying to recreate, while not taking the previous one down.

Here are your options under your circumstances.

  1. Do all your web development locally which is a pain, as it means setting up a wamp for windows or mamp environment which just makes it more tricky and also means showing your client online is not really an option.
  2. Go to you cPanel and under file manager compress the entire public_html directory at its correct 1996 state so you can work on the site, test it when finished for the day just restore it if it’s not a high traffic site.
    I would suggest a full manual backup anyway to avoid this issue in future.
  3. Create a subdomain on your hosting provider and do all your testing there.
  4. If you have a dedicated server like me, then do as I did in my video with tricking your computers hosts file to believe the domain is on another server just on your computer.
  5. Dont use the same naming for your new files and folders on your server, use different ones so they never overwrite.

Honestly I would be open to suggestions on this particular one too as it is something that has always plagued me although it does not relate to Wappler or any other web development tool.

Thanks for the detailed thoughts. Wappler seems to be a great tool for somethings and not so great for others. I was hoping at least to be able to develop pages with database functionality and then load them.

I have been doing someting like that for years using PhPRuinner, bit the pages (only .php) look plain. Tried to have the query show in a nicely formatted Bootstrap or other .html file and so far no luck. That is why i am giving wappler a shot.

But to be clear - I have to connect to my site in order to design the database queries. But if i just connect, i run the likelyhood that the site will be “updated” if I don’t use one of the great ideas you presents. For instance making a subdomain soulnds good.

This issue is not really a Wappler one, it has followed me from one tool to another for years.
My sites I work on are mostly live sites being revamped and i can not take them down or alter until the client has fully checked and approved it.
Therefore without a dedicated server to create fake sites like me, i would possibly go the create a subdomain on your existing domain route. This way it’s still live, you cant overwrite your existing files, and it’s easy to publish the real site later.
So in cpanel you will need to click subdomains and create one like test.example.com and then make another ftp user for that so you are only accessing that area.

Wow, you would do that? The site is https://www.mexicomike.com but i am not sure you can see the structure. Is there any way to send a screenshot or something?

Yes, that gives me a decent idea of your site structure, I will send through a screenshot or 2 of the subdomain setup, would just possibly be easiest and safest.

By the way for a site created back in 1996 well done in not having a search bar that is susceptible to SQL injection, nice to see a sanitized query for a site that old.

Why thank you for the observations. I update it frequently and change the cosmetic design once a year. So can’t claim to have done anything right back then, just try to do it now. Right now it is a hodgepodge of designs. I was doing my annual update and developed eye problems. Thought i was going to go blind. Scary. But now i can see again and back at it.

With being sight-impaired (got better, not well) I have to bump resolution. Set screen resolution on my 27 inch monitors to 200% -225%. So far every Windows program has worked fine. But Wappler takes over the whole screen and i have to take resolution down to 100% for it to fit on screen. A real pain as i switch to another program. Any ideas?