Deleted Yii root directory using "recursive unlink" when extracting a tar over it, now receiving file not found in web browser

Hi I am very new to YII and web server development in general so my knowledge is pretty limited;

I’ve made some changes on the yii directory and I backed it up using tar. I backed up the original directory and I backed up the changes I made into two separate tar files. The first few times I extracted it into the yii folder(root directory for yii), the changes were present and there were no issues, however I had to manually delete the additional files I had in that directory (such as additional view files) before I extracted over the directory.

To make things more convenient and avoid user error, I decided to extract over that directory using the command sudo tar -xvf admin.tar --recursive-unlink --unlink-first - C afterwards in order to delete the files that were added in the yii directory. However, I checked the browser for the site and I now receive the error “file not found”.

I tried removing the newly extracted root directory and then reextracting the backup again with out using --recursive-unlink and --unlink-first , however the browser still gives me “file not found”.

I know this is kind of a hail mary asking on here for advice how to fix this, but I’m honestly at loss and my company really needs to get this website back up and running. Does anyone have any advice on what I should do to get yii back up and running?

Thank you very much for any advice.

Hi @Jshermis

Couples of questions, first.

  1. Where was your yii project located?
    I mean, was it /var/www/your_project or something like that?
  2. What did you do to install yii?
    Did you use app-basic to start yii?
  3. What was the directory structure of it?
    Usually an app-basic has a directory structure like the following. Did you have the same?
project
    assets
    commands
    config
    controllers
    migrations
    models
    runtime
    vendor
    views
    web
    ...
  1. What is the root directory of your tar ball?
    Did you create an archive of the whole project?
  2. What file exactly is not found?

Hi softark,

Thanks for replying to me. I wanted to to give you an update. So in this particular case yii was installed in a php container. One of my associates recommended restarting the container with the command “docker restart <container #>”, and it started working again, however it doesn’t quite render all the pages correctly and it looks like it’s missing some CSS and other bootstrap code to make it display properly.

Do you have any ideas about what could be causing this after resetting the container that yii was installed in?

Thanks again for trying to help.

To answer your questions:

  1. The project itself was located in a web accessible folder. yes it was something along those lines.

  2. Yii was installed using a container, I’m not sure how it was installed but it does appear to use the basic layout, and appears to have used composer.

  3. The directory structure looked exactly as you posted it.

  4. The root directory is the the directory containing the whole project, and yes, I did create an archive of the whole project.

  5. It didn’t specify which file was not found. It just said “file not found”. With the container reset it is working again but it is still not rendering properly and appears to be missing alot of CSS and HTML on all the pages.

Thanks again for your help and sorry for the late reply.

I would check the permissions of web/assets and runtime.